Re: [PATCH] usb: fix defined but not used warnings in hcd-pci.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 25 Feb 2012, Paul Gortmaker wrote:

> Shows up on ia64 builds (and possibly elsewhere) for configs that
> don't set PM_RUNTIME or PM_SLEEP as follows:
> 
> drivers/usb/core/hcd-pci.c:383:12: warning: 'suspend_common' defined but not used
> drivers/usb/core/hcd-pci.c:438:12: warning: 'resume_common' defined but not used
> 
> As per above, the functions are only used if RUNTIME/SLEEP are set,
> so make the two functions conditional on these Kconfig values.
> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>
> ---
> 
> [seen in linux-next-20120224 tree; may or may not be also in mainline]
> 
> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
> index 81e2c0d..622b4a4 100644
> --- a/drivers/usb/core/hcd-pci.c
> +++ b/drivers/usb/core/hcd-pci.c
> @@ -380,6 +380,7 @@ static int check_root_hub_suspended(struct device *dev)
>  	return 0;
>  }
>  
> +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
>  static int suspend_common(struct device *dev, bool do_wakeup)
>  {
>  	struct pci_dev		*pci_dev = to_pci_dev(dev);
> @@ -471,6 +472,7 @@ static int resume_common(struct device *dev, int event)
>  	}
>  	return retval;
>  }
> +#endif	/* SLEEP || RUNTIME */
>  
>  #ifdef	CONFIG_PM_SLEEP

Don't you also need to include powermac_set_asic() in the #if block?
And you might as well include check_root_hub_suspended() too (just 
remember to define it as NULL if neither SLEEP nor RUNTIME is enabled).

Alan Stern

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux