Thread (40 messages) flat view 40 messages, 4 authors, 2016-02-07

Re: [PATCH v2 21/22] sound/usb: Use Media Controller API to share media resources

From: Takashi Iwai <hidden>
Date: 2016-02-04 10:46:59
Also in: alsa-devel, linux-media, lkml

On Thu, 04 Feb 2016 11:36:00 +0100,
Mauro Carvalho Chehab wrote:
quoted
diff --git a/sound/usb/card.h b/sound/usb/card.h
index 71778ca..c15a03c 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -156,6 +156,7 @@ struct snd_usb_substream {
 	} dsd_dop;
 
 	bool trigger_tstamp_pending_update; /* trigger timestamp being updated from initial estimate */
+	void *media_ctl;
 };
This is Takashi's call, but I would prefer to avoid using a void *
here. Fortunately, GCC is smart enough to handle struct pointers
even if the header doesn't have a full declaration of the struct.

So, I would change the above to:

struct media_device;

struct snd_usb_substream {
...
	struct media_device *media_ctl;
};

This way, we ensure strong typecast checks when compiling the code under
sound/usb/media.c, while not needing to include media_device.h header here.
Agreed, this is no big merit to make it a void pointer.


Takashi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help