linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] hide unused functions for !MEDIA_CONTROLLER
@ 2016-03-05  0:06 Arnd Bergmann
  2016-03-05  0:34 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-03-05  0:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Arnd Bergmann, Shuah Khan, Hans Verkuil,
	Rafael Lourenço de Lima Chehab, Javier Martinez Canillas,
	linux-media, linux-kernel

Some functions in the au0828 driver are only used when CONFIG_MEDIA_CONTROLLER
is enabled, and otherwise defined as empty functions:

media/usb/au0828/au0828-core.c:208:13: error: 'au0828_media_graph_notify' defined but not used [-Werror=unused-function]
media/usb/au0828/au0828-core.c:262:12: error: 'au0828_enable_source' defined but not used [-Werror=unused-function]
media/usb/au0828/au0828-core.c:412:13: error: 'au0828_disable_source' defined but not used [-Werror=unused-function]

This moves the #ifdef so the entire definitions are hidden in this case.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/usb/au0828/au0828-core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 4ffaa3b2e905..d312098720a8 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -205,10 +205,10 @@ static int au0828_media_device_init(struct au0828_dev *dev,
 	return 0;
 }
 
+#ifdef CONFIG_MEDIA_CONTROLLER
 static void au0828_media_graph_notify(struct media_entity *new,
 				      void *notify_data)
 {
-#ifdef CONFIG_MEDIA_CONTROLLER
 	struct au0828_dev *dev = (struct au0828_dev *) notify_data;
 	int ret;
 	struct media_entity *entity, *mixer = NULL, *decoder = NULL;
@@ -256,13 +256,11 @@ create_link:
 			dev_err(&dev->usbdev->dev,
 				"Mixer Pad Link Create Error: %d\n", ret);
 	}
-#endif
 }
 
 static int au0828_enable_source(struct media_entity *entity,
 				struct media_pipeline *pipe)
 {
-#ifdef CONFIG_MEDIA_CONTROLLER
 	struct media_entity  *source, *find_source;
 	struct media_entity *sink;
 	struct media_link *link, *found_link = NULL;
@@ -405,13 +403,11 @@ end:
 	pr_debug("au0828_enable_source() end %s %d %d\n",
 		 entity->name, entity->function, ret);
 	return ret;
-#endif
 	return 0;
 }
 
 static void au0828_disable_source(struct media_entity *entity)
 {
-#ifdef CONFIG_MEDIA_CONTROLLER
 	int ret = 0;
 	struct media_device *mdev = entity->graph_obj.mdev;
 	struct au0828_dev *dev;
@@ -453,8 +449,8 @@ static void au0828_disable_source(struct media_entity *entity)
 
 end:
 	mutex_unlock(&mdev->graph_mutex);
-#endif
 }
+#endif
 
 static int au0828_media_device_register(struct au0828_dev *dev,
 					struct usb_device *udev)
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] [media] hide unused functions for !MEDIA_CONTROLLER
  2016-03-05  0:06 [PATCH] [media] hide unused functions for !MEDIA_CONTROLLER Arnd Bergmann
@ 2016-03-05  0:34 ` Shuah Khan
  2016-03-05 12:08   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2016-03-05  0:34 UTC (permalink / raw)
  To: Arnd Bergmann, Mauro Carvalho Chehab
  Cc: Hans Verkuil, Rafael Lourenço de Lima Chehab,
	Javier Martinez Canillas, linux-media, linux-kernel, Shuah Khan

On 03/04/2016 05:06 PM, Arnd Bergmann wrote:
> Some functions in the au0828 driver are only used when CONFIG_MEDIA_CONTROLLER
> is enabled, and otherwise defined as empty functions:
> 
> media/usb/au0828/au0828-core.c:208:13: error: 'au0828_media_graph_notify' defined but not used [-Werror=unused-function]
> media/usb/au0828/au0828-core.c:262:12: error: 'au0828_enable_source' defined but not used [-Werror=unused-function]
> media/usb/au0828/au0828-core.c:412:13: error: 'au0828_disable_source' defined but not used [-Werror=unused-function]
> 
> This moves the #ifdef so the entire definitions are hidden in this case.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for fixing this.

Comments below:

> ---
>  drivers/media/usb/au0828/au0828-core.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
> index 4ffaa3b2e905..d312098720a8 100644
> --- a/drivers/media/usb/au0828/au0828-core.c
> +++ b/drivers/media/usb/au0828/au0828-core.c
> @@ -205,10 +205,10 @@ static int au0828_media_device_init(struct au0828_dev *dev,
>  	return 0;
>  }
>  
> +#ifdef CONFIG_MEDIA_CONTROLLER
>  static void au0828_media_graph_notify(struct media_entity *new,
>  				      void *notify_data)
>  {
> -#ifdef CONFIG_MEDIA_CONTROLLER
>  	struct au0828_dev *dev = (struct au0828_dev *) notify_data;
>  	int ret;
>  	struct media_entity *entity, *mixer = NULL, *decoder = NULL;
> @@ -256,13 +256,11 @@ create_link:
>  			dev_err(&dev->usbdev->dev,
>  				"Mixer Pad Link Create Error: %d\n", ret);
>  	}
> -#endif
>  }
>  
>  static int au0828_enable_source(struct media_entity *entity,
>  				struct media_pipeline *pipe)
>  {
> -#ifdef CONFIG_MEDIA_CONTROLLER
>  	struct media_entity  *source, *find_source;
>  	struct media_entity *sink;
>  	struct media_link *link, *found_link = NULL;
> @@ -405,13 +403,11 @@ end:
>  	pr_debug("au0828_enable_source() end %s %d %d\n",
>  		 entity->name, entity->function, ret);
>  	return ret;
> -#endif
>  	return 0;

The above return 0 isn't needed with the change you made.


>  }
>  
>  static void au0828_disable_source(struct media_entity *entity)
>  {
> -#ifdef CONFIG_MEDIA_CONTROLLER
>  	int ret = 0;
>  	struct media_device *mdev = entity->graph_obj.mdev;
>  	struct au0828_dev *dev;
> @@ -453,8 +449,8 @@ static void au0828_disable_source(struct media_entity *entity)
>  
>  end:
>  	mutex_unlock(&mdev->graph_mutex);
> -#endif
>  }
> +#endif
>  
>  static int au0828_media_device_register(struct au0828_dev *dev,
>  					struct usb_device *udev)
> 

-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [media] hide unused functions for !MEDIA_CONTROLLER
  2016-03-05  0:34 ` Shuah Khan
@ 2016-03-05 12:08   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-05 12:08 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Arnd Bergmann, Hans Verkuil, Rafael Lourenço de Lima Chehab,
	Javier Martinez Canillas, linux-media, linux-kernel

Em Fri, 4 Mar 2016 17:34:43 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:

> On 03/04/2016 05:06 PM, Arnd Bergmann wrote:
> > Some functions in the au0828 driver are only used when CONFIG_MEDIA_CONTROLLER
> > is enabled, and otherwise defined as empty functions:
> > 
> > media/usb/au0828/au0828-core.c:208:13: error: 'au0828_media_graph_notify' defined but not used [-Werror=unused-function]
> > media/usb/au0828/au0828-core.c:262:12: error: 'au0828_enable_source' defined but not used [-Werror=unused-function]
> > media/usb/au0828/au0828-core.c:412:13: error: 'au0828_disable_source' defined but not used [-Werror=unused-function]
> > 
> > This moves the #ifdef so the entire definitions are hidden in this case.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>  
> 
> Thanks for fixing this.
> 
> Comments below:
> 
> > ---
> >  drivers/media/usb/au0828/au0828-core.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
> > index 4ffaa3b2e905..d312098720a8 100644
> > --- a/drivers/media/usb/au0828/au0828-core.c
> > +++ b/drivers/media/usb/au0828/au0828-core.c
> > @@ -205,10 +205,10 @@ static int au0828_media_device_init(struct au0828_dev *dev,
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_MEDIA_CONTROLLER
> >  static void au0828_media_graph_notify(struct media_entity *new,
> >  				      void *notify_data)
> >  {
> > -#ifdef CONFIG_MEDIA_CONTROLLER
> >  	struct au0828_dev *dev = (struct au0828_dev *) notify_data;
> >  	int ret;
> >  	struct media_entity *entity, *mixer = NULL, *decoder = NULL;
> > @@ -256,13 +256,11 @@ create_link:
> >  			dev_err(&dev->usbdev->dev,
> >  				"Mixer Pad Link Create Error: %d\n", ret);
> >  	}
> > -#endif
> >  }
> >  
> >  static int au0828_enable_source(struct media_entity *entity,
> >  				struct media_pipeline *pipe)
> >  {
> > -#ifdef CONFIG_MEDIA_CONTROLLER
> >  	struct media_entity  *source, *find_source;
> >  	struct media_entity *sink;
> >  	struct media_link *link, *found_link = NULL;
> > @@ -405,13 +403,11 @@ end:
> >  	pr_debug("au0828_enable_source() end %s %d %d\n",
> >  		 entity->name, entity->function, ret);
> >  	return ret;
> > -#endif
> >  	return 0;  
> 
> The above return 0 isn't needed with the change you made.

Applied with the above suggestion of removing return 0.

Regards,
Mauro

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-05 12:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-05  0:06 [PATCH] [media] hide unused functions for !MEDIA_CONTROLLER Arnd Bergmann
2016-03-05  0:34 ` Shuah Khan
2016-03-05 12:08   ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).