From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH v2 21/22] sound/usb: Use Media Controller API to share media resources Date: Thu, 04 Feb 2016 11:46:42 +0100 Message-ID: References: <20160204083600.334a43f9@recife.lan> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20160204083600.334a43f9@recife.lan> Sender: linux-kernel-owner@vger.kernel.org To: Mauro Carvalho Chehab Cc: Shuah Khan , geliangtang@163.com, alsa-devel@alsa-project.org, arnd@arndb.de, ricard.wanderlof@axis.com, hans.verkuil@cisco.com, labbott@fedoraproject.org, chehabrafael@gmail.com, klock.android@gmail.com, misterpib@gmail.com, prabhakar.csengg@gmail.com, ricardo.ribalda@gmail.com, ruchandani.tina@gmail.com, takamichiho@gmail.com, tvboxspy@gmail.com, dominic.sacre@gmx.de, laurent.pinchart@ideasonboard.com, crope@iki.fi, julian@jusst.de, clemens@ladisch.de, pierre-louis.bossart@linux.intel.com, sakari.ailus@linux.intel.com, corbet@lwn.net, joe@oampo.co.uk, johan@oljud.se, dan.carpenter@oracle.com, pawel@osciak.com, javier@osg.samsung.com, p.zabel@pengutronix.de, perex@perex.cz, stefanr@s5r6.in-berlin.de, inki.dae@samsung.com, j.anaszewski@samsung.com, jh1009.sung@samsung.comk List-Id: alsa-devel@alsa-project.org On Thu, 04 Feb 2016 11:36:00 +0100, Mauro Carvalho Chehab wrote: > > > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx2.suse.de ([195.135.220.15]:54852 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756174AbcBDKqr (ORCPT ); Thu, 4 Feb 2016 05:46:47 -0500 Date: Thu, 04 Feb 2016 11:46:42 +0100 Message-ID: From: Takashi Iwai To: "Mauro Carvalho Chehab" Cc: "Shuah Khan" , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 21/22] sound/usb: Use Media Controller API to share media resources In-Reply-To: <20160204083600.334a43f9@recife.lan> References: <20160204083600.334a43f9@recife.lan> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-media-owner@vger.kernel.org List-ID: On Thu, 04 Feb 2016 11:36:00 +0100, Mauro Carvalho Chehab wrote: > > > 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