public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
@ 2013-12-13  1:06 Santosh Shilimkar
  2013-12-13  1:51 ` David Cohen
  0 siblings, 1 reply; 7+ messages in thread
From: Santosh Shilimkar @ 2013-12-13  1:06 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, Santosh Shilimkar, Sarah Sharp, Greg Kroah-Hartman

Otherwise you get below build warnings

drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]

Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 drivers/usb/host/xhci-plat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index d9c169f..4875be5 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int xhci_plat_suspend(struct device *dev)
 {
 	struct usb_hcd	*hcd = dev_get_drvdata(dev);
@@ -220,7 +220,7 @@ static const struct dev_pm_ops xhci_plat_pm_ops = {
 #define DEV_PM_OPS	(&xhci_plat_pm_ops)
 #else
 #define DEV_PM_OPS	NULL
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
 
 #ifdef CONFIG_OF
 static const struct of_device_id usb_xhci_of_match[] = {
-- 
1.7.9.5


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

* Re: [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
  2013-12-13  1:06 [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning Santosh Shilimkar
@ 2013-12-13  1:51 ` David Cohen
  2013-12-13  2:01   ` Santosh Shilimkar
  0 siblings, 1 reply; 7+ messages in thread
From: David Cohen @ 2013-12-13  1:51 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-usb, linux-kernel, Sarah Sharp, Greg Kroah-Hartman

On Thu, Dec 12, 2013 at 08:06:24PM -0500, Santosh Shilimkar wrote:
> Otherwise you get below build warnings
> 
> drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> 
> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  drivers/usb/host/xhci-plat.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index d9c169f..4875be5 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP

Can't you just remove these #ifdefs altogether?
xhci_plat_pm_ops is set using SET_SYSTEM_SLEEP_PM_OPS() macro which
already handles '#ifdef CONFIG_PM_SLEEP' case.

>  static int xhci_plat_suspend(struct device *dev)
>  {
>  	struct usb_hcd	*hcd = dev_get_drvdata(dev);
> @@ -220,7 +220,7 @@ static const struct dev_pm_ops xhci_plat_pm_ops = {
>  #define DEV_PM_OPS	(&xhci_plat_pm_ops)
>  #else
>  #define DEV_PM_OPS	NULL
> -#endif /* CONFIG_PM */
> +#endif /* CONFIG_PM_SLEEP */

Ditto.

Br, David Cohen

>  
>  #ifdef CONFIG_OF
>  static const struct of_device_id usb_xhci_of_match[] = {
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
  2013-12-13  1:51 ` David Cohen
@ 2013-12-13  2:01   ` Santosh Shilimkar
  2013-12-13  3:25     ` David Cohen
  0 siblings, 1 reply; 7+ messages in thread
From: Santosh Shilimkar @ 2013-12-13  2:01 UTC (permalink / raw)
  To: David Cohen; +Cc: linux-usb, linux-kernel, Sarah Sharp, Greg Kroah-Hartman

On Thursday 12 December 2013 08:51 PM, David Cohen wrote:
> On Thu, Dec 12, 2013 at 08:06:24PM -0500, Santosh Shilimkar wrote:
>> Otherwise you get below build warnings
>>
>> drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
>> drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
>>
>> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> ---
>>  drivers/usb/host/xhci-plat.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
>> index d9c169f..4875be5 100644
>> --- a/drivers/usb/host/xhci-plat.c
>> +++ b/drivers/usb/host/xhci-plat.c
>> @@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
>>  	return 0;
>>  }
>>  
>> -#ifdef CONFIG_PM
>> +#ifdef CONFIG_PM_SLEEP
> 
> Can't you just remove these #ifdefs altogether?
> xhci_plat_pm_ops is set using SET_SYSTEM_SLEEP_PM_OPS() macro which
> already handles '#ifdef CONFIG_PM_SLEEP' case.
> 
It does handle the difference but the hooks implemented would
show-up un-used warning if you remove the #ifdefs.

drivers/usb/host/xhci-plat.c:200:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
drivers/usb/host/xhci-plat.c:208:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]

So you need to wrap them under the PM_SLEEP check.

Regards,
Santosh


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

* Re: [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
  2013-12-13  2:01   ` Santosh Shilimkar
@ 2013-12-13  3:25     ` David Cohen
  2013-12-13  5:23       ` David Cohen
  0 siblings, 1 reply; 7+ messages in thread
From: David Cohen @ 2013-12-13  3:25 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-usb, linux-kernel, Sarah Sharp, Greg Kroah-Hartman

On Thu, Dec 12, 2013 at 09:01:04PM -0500, Santosh Shilimkar wrote:
> On Thursday 12 December 2013 08:51 PM, David Cohen wrote:
> > On Thu, Dec 12, 2013 at 08:06:24PM -0500, Santosh Shilimkar wrote:
> >> Otherwise you get below build warnings
> >>
> >> drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> >> drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> >>
> >> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >> ---
> >>  drivers/usb/host/xhci-plat.c |    4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> >> index d9c169f..4875be5 100644
> >> --- a/drivers/usb/host/xhci-plat.c
> >> +++ b/drivers/usb/host/xhci-plat.c
> >> @@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
> >>  	return 0;
> >>  }
> >>  
> >> -#ifdef CONFIG_PM
> >> +#ifdef CONFIG_PM_SLEEP
> > 
> > Can't you just remove these #ifdefs altogether?
> > xhci_plat_pm_ops is set using SET_SYSTEM_SLEEP_PM_OPS() macro which
> > already handles '#ifdef CONFIG_PM_SLEEP' case.
> > 
> It does handle the difference but the hooks implemented would
> show-up un-used warning if you remove the #ifdefs.
> 
> drivers/usb/host/xhci-plat.c:200:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> drivers/usb/host/xhci-plat.c:208:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> 
> So you need to wrap them under the PM_SLEEP check.

Yeah... it's not smart enought :)
But you could still remove the #else condition and the ugly DEV_PM_OPS
macro.

Br, David

> 
> Regards,
> Santosh

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

* Re: [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
  2013-12-13  3:25     ` David Cohen
@ 2013-12-13  5:23       ` David Cohen
  2013-12-13 22:55         ` Santosh Shilimkar
  0 siblings, 1 reply; 7+ messages in thread
From: David Cohen @ 2013-12-13  5:23 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-usb, linux-kernel, Sarah Sharp, Greg Kroah-Hartman

On Thu, Dec 12, 2013 at 07:25:55PM -0800, David Cohen wrote:
> On Thu, Dec 12, 2013 at 09:01:04PM -0500, Santosh Shilimkar wrote:
> > On Thursday 12 December 2013 08:51 PM, David Cohen wrote:
> > > On Thu, Dec 12, 2013 at 08:06:24PM -0500, Santosh Shilimkar wrote:
> > >> Otherwise you get below build warnings
> > >>
> > >> drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> > >> drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> > >>
> > >> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
> > >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > >> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > >> ---
> > >>  drivers/usb/host/xhci-plat.c |    4 ++--
> > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > >>
> > >> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > >> index d9c169f..4875be5 100644
> > >> --- a/drivers/usb/host/xhci-plat.c
> > >> +++ b/drivers/usb/host/xhci-plat.c
> > >> @@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
> > >>  	return 0;
> > >>  }
> > >>  
> > >> -#ifdef CONFIG_PM
> > >> +#ifdef CONFIG_PM_SLEEP
> > > 
> > > Can't you just remove these #ifdefs altogether?
> > > xhci_plat_pm_ops is set using SET_SYSTEM_SLEEP_PM_OPS() macro which
> > > already handles '#ifdef CONFIG_PM_SLEEP' case.
> > > 
> > It does handle the difference but the hooks implemented would
> > show-up un-used warning if you remove the #ifdefs.
> > 
> > drivers/usb/host/xhci-plat.c:200:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> > drivers/usb/host/xhci-plat.c:208:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> > 
> > So you need to wrap them under the PM_SLEEP check.
> 
> Yeah... it's not smart enought :)
> But you could still remove the #else condition and the ugly DEV_PM_OPS
> macro.

Since this patch is not urgent, I sent a RFC proposing smarter
SET_*_PM_OPS(). I included your patch (a bit different) here:
https://patchwork.kernel.org/patch/3337961/

Br, David

> 
> Br, David
> 
> > 
> > Regards,
> > Santosh
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
  2013-12-13  5:23       ` David Cohen
@ 2013-12-13 22:55         ` Santosh Shilimkar
  2013-12-14  1:16           ` David Cohen
  0 siblings, 1 reply; 7+ messages in thread
From: Santosh Shilimkar @ 2013-12-13 22:55 UTC (permalink / raw)
  To: David Cohen; +Cc: linux-usb, linux-kernel, Sarah Sharp, Greg Kroah-Hartman

On Friday 13 December 2013 12:23 AM, David Cohen wrote:
> On Thu, Dec 12, 2013 at 07:25:55PM -0800, David Cohen wrote:
>> On Thu, Dec 12, 2013 at 09:01:04PM -0500, Santosh Shilimkar wrote:
>>> On Thursday 12 December 2013 08:51 PM, David Cohen wrote:
>>>> On Thu, Dec 12, 2013 at 08:06:24PM -0500, Santosh Shilimkar wrote:
>>>>> Otherwise you get below build warnings
>>>>>
>>>>> drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
>>>>> drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
>>>>>
>>>>> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
>>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>>>> ---
>>>>>  drivers/usb/host/xhci-plat.c |    4 ++--
>>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
>>>>> index d9c169f..4875be5 100644
>>>>> --- a/drivers/usb/host/xhci-plat.c
>>>>> +++ b/drivers/usb/host/xhci-plat.c
>>>>> @@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
>>>>>  	return 0;
>>>>>  }
>>>>>  
>>>>> -#ifdef CONFIG_PM
>>>>> +#ifdef CONFIG_PM_SLEEP
>>>>
>>>> Can't you just remove these #ifdefs altogether?
>>>> xhci_plat_pm_ops is set using SET_SYSTEM_SLEEP_PM_OPS() macro which
>>>> already handles '#ifdef CONFIG_PM_SLEEP' case.
>>>>
>>> It does handle the difference but the hooks implemented would
>>> show-up un-used warning if you remove the #ifdefs.
>>>
>>> drivers/usb/host/xhci-plat.c:200:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
>>> drivers/usb/host/xhci-plat.c:208:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
>>>
>>> So you need to wrap them under the PM_SLEEP check.
>>
>> Yeah... it's not smart enought :)
>> But you could still remove the #else condition and the ugly DEV_PM_OPS
>> macro.
> 
> Since this patch is not urgent, I sent a RFC proposing smarter
> SET_*_PM_OPS(). I included your patch (a bit different) here:
> https://patchwork.kernel.org/patch/3337961/
> 
Thats fine by me if you can get your RFC through.

Regards,
Santosh


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

* Re: [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning
  2013-12-13 22:55         ` Santosh Shilimkar
@ 2013-12-14  1:16           ` David Cohen
  0 siblings, 0 replies; 7+ messages in thread
From: David Cohen @ 2013-12-14  1:16 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-usb, linux-kernel, Sarah Sharp, Greg Kroah-Hartman

On Fri, Dec 13, 2013 at 05:55:20PM -0500, Santosh Shilimkar wrote:
> On Friday 13 December 2013 12:23 AM, David Cohen wrote:
> > On Thu, Dec 12, 2013 at 07:25:55PM -0800, David Cohen wrote:
> >> On Thu, Dec 12, 2013 at 09:01:04PM -0500, Santosh Shilimkar wrote:
> >>> On Thursday 12 December 2013 08:51 PM, David Cohen wrote:
> >>>> On Thu, Dec 12, 2013 at 08:06:24PM -0500, Santosh Shilimkar wrote:
> >>>>> Otherwise you get below build warnings
> >>>>>
> >>>>> drivers/usb/host/xhci-plat.c:201:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> >>>>> drivers/usb/host/xhci-plat.c:209:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> >>>>>
> >>>>> Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
> >>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >>>>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >>>>> ---
> >>>>>  drivers/usb/host/xhci-plat.c |    4 ++--
> >>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>>>
> >>>>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> >>>>> index d9c169f..4875be5 100644
> >>>>> --- a/drivers/usb/host/xhci-plat.c
> >>>>> +++ b/drivers/usb/host/xhci-plat.c
> >>>>> @@ -197,7 +197,7 @@ static int xhci_plat_remove(struct platform_device *dev)
> >>>>>  	return 0;
> >>>>>  }
> >>>>>  
> >>>>> -#ifdef CONFIG_PM
> >>>>> +#ifdef CONFIG_PM_SLEEP
> >>>>
> >>>> Can't you just remove these #ifdefs altogether?
> >>>> xhci_plat_pm_ops is set using SET_SYSTEM_SLEEP_PM_OPS() macro which
> >>>> already handles '#ifdef CONFIG_PM_SLEEP' case.
> >>>>
> >>> It does handle the difference but the hooks implemented would
> >>> show-up un-used warning if you remove the #ifdefs.
> >>>
> >>> drivers/usb/host/xhci-plat.c:200:12: warning: ‘xhci_plat_suspend’ defined but not used [-Wunused-function]
> >>> drivers/usb/host/xhci-plat.c:208:12: warning: ‘xhci_plat_resume’ defined but not used [-Wunused-function]
> >>>
> >>> So you need to wrap them under the PM_SLEEP check.
> >>
> >> Yeah... it's not smart enought :)
> >> But you could still remove the #else condition and the ugly DEV_PM_OPS
> >> macro.
> > 
> > Since this patch is not urgent, I sent a RFC proposing smarter
> > SET_*_PM_OPS(). I included your patch (a bit different) here:
> > https://patchwork.kernel.org/patch/3337961/
> > 
> Thats fine by me if you can get your RFC through.

Thanks. I'll keep trying in this case.

Br, David

> 
> Regards,
> Santosh
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-12-14  1:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-13  1:06 [PATCH] usb: host: xhci: Move suspend ops under PM_SLEEP to avoid warning Santosh Shilimkar
2013-12-13  1:51 ` David Cohen
2013-12-13  2:01   ` Santosh Shilimkar
2013-12-13  3:25     ` David Cohen
2013-12-13  5:23       ` David Cohen
2013-12-13 22:55         ` Santosh Shilimkar
2013-12-14  1:16           ` David Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox