netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused
@ 2018-01-16  9:14 Arnd Bergmann
  2018-01-16 16:12 ` Keller, Jacob E
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-16  9:14 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Arnd Bergmann, Jacob Keller, David S. Miller, Ngai-Mint Kwan,
	intel-wired-lan, netdev, linux-kernel

A cleanup of the PM code left an incorrect #ifdef in place, leading
to a harmless build warning:

drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2502:12: error: 'fm10k_suspend' defined but not used [-Werror=unused-function]
drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2475:12: error: 'fm10k_resume' defined but not used [-Werror=unused-function]

It's easier to use __maybe_unused attributes here, since you
can't pick the wrong one.

Fixes: 8249c47c6ba4 ("fm10k: use generic PM hooks instead of legacy PCIe power hooks")
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Apparently nobody picked this up the first time around (Oct 2017),
here is the same patch again.
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 7f605221a686..a434fecfdfeb 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -2463,7 +2463,6 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
 	return err;
 }
 
-#ifdef CONFIG_PM
 /**
  * fm10k_resume - Generic PM resume hook
  * @dev: generic device structure
@@ -2472,7 +2471,7 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
  * suspend or hibernation. This function does not need to handle lower PCIe
  * device state as the stack takes care of that for us.
  **/
-static int fm10k_resume(struct device *dev)
+static int __maybe_unused fm10k_resume(struct device *dev)
 {
 	struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
 	struct net_device *netdev = interface->netdev;
@@ -2499,7 +2498,7 @@ static int fm10k_resume(struct device *dev)
  * system suspend or hibernation. This function does not need to handle lower
  * PCIe device state as the stack takes care of that for us.
  **/
-static int fm10k_suspend(struct device *dev)
+static int __maybe_unused fm10k_suspend(struct device *dev)
 {
 	struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
 	struct net_device *netdev = interface->netdev;
@@ -2511,8 +2510,6 @@ static int fm10k_suspend(struct device *dev)
 	return 0;
 }
 
-#endif /* CONFIG_PM */
-
 /**
  * fm10k_io_error_detected - called when PCI error is detected
  * @pdev: Pointer to PCI device
@@ -2643,11 +2640,9 @@ static struct pci_driver fm10k_driver = {
 	.id_table		= fm10k_pci_tbl,
 	.probe			= fm10k_probe,
 	.remove			= fm10k_remove,
-#ifdef CONFIG_PM
 	.driver = {
 		.pm		= &fm10k_pm_ops,
 	},
-#endif /* CONFIG_PM */
 	.sriov_configure	= fm10k_iov_configure,
 	.err_handler		= &fm10k_err_handler
 };
-- 
2.9.0

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

* RE: [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused
  2018-01-16  9:14 [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused Arnd Bergmann
@ 2018-01-16 16:12 ` Keller, Jacob E
  2018-01-16 16:20   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Keller, Jacob E @ 2018-01-16 16:12 UTC (permalink / raw)
  To: Arnd Bergmann, Kirsher, Jeffrey T
  Cc: David S. Miller, Kwan, Ngai-mint,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: Tuesday, January 16, 2018 1:14 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; Keller, Jacob E
> <jacob.e.keller@intel.com>; David S. Miller <davem@davemloft.net>; Kwan,
> Ngai-mint <ngai-mint.kwan@intel.com>; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused
> 
> A cleanup of the PM code left an incorrect #ifdef in place, leading
> to a harmless build warning:
> 
> drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2502:12: error: 'fm10k_suspend'
> defined but not used [-Werror=unused-function]
> drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2475:12: error: 'fm10k_resume'
> defined but not used [-Werror=unused-function]
> 
> It's easier to use __maybe_unused attributes here, since you
> can't pick the wrong one.
> 
> Fixes: 8249c47c6ba4 ("fm10k: use generic PM hooks instead of legacy PCIe power
> hooks")
> Acked-by: Jacob Keller <jacob.e.keller@intel.com>
> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Apparently nobody picked this up the first time around (Oct 2017),
> here is the same patch again.

Odd. I remember seeing this and thought I ack'd it..? Guess it got missed.

Acked-by: Jacob Keller <jacob.e.keller@intel.com>

> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> index 7f605221a686..a434fecfdfeb 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> @@ -2463,7 +2463,6 @@ static int fm10k_handle_resume(struct fm10k_intfc
> *interface)
>  	return err;
>  }
> 
> -#ifdef CONFIG_PM
>  /**
>   * fm10k_resume - Generic PM resume hook
>   * @dev: generic device structure
> @@ -2472,7 +2471,7 @@ static int fm10k_handle_resume(struct fm10k_intfc
> *interface)
>   * suspend or hibernation. This function does not need to handle lower PCIe
>   * device state as the stack takes care of that for us.
>   **/
> -static int fm10k_resume(struct device *dev)
> +static int __maybe_unused fm10k_resume(struct device *dev)
>  {
>  	struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
>  	struct net_device *netdev = interface->netdev;
> @@ -2499,7 +2498,7 @@ static int fm10k_resume(struct device *dev)
>   * system suspend or hibernation. This function does not need to handle lower
>   * PCIe device state as the stack takes care of that for us.
>   **/
> -static int fm10k_suspend(struct device *dev)
> +static int __maybe_unused fm10k_suspend(struct device *dev)
>  {
>  	struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
>  	struct net_device *netdev = interface->netdev;
> @@ -2511,8 +2510,6 @@ static int fm10k_suspend(struct device *dev)
>  	return 0;
>  }
> 
> -#endif /* CONFIG_PM */
> -
>  /**
>   * fm10k_io_error_detected - called when PCI error is detected
>   * @pdev: Pointer to PCI device
> @@ -2643,11 +2640,9 @@ static struct pci_driver fm10k_driver = {
>  	.id_table		= fm10k_pci_tbl,
>  	.probe			= fm10k_probe,
>  	.remove			= fm10k_remove,
> -#ifdef CONFIG_PM
>  	.driver = {
>  		.pm		= &fm10k_pm_ops,
>  	},
> -#endif /* CONFIG_PM */
>  	.sriov_configure	= fm10k_iov_configure,
>  	.err_handler		= &fm10k_err_handler
>  };
> --
> 2.9.0

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

* Re: [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused
  2018-01-16 16:12 ` Keller, Jacob E
@ 2018-01-16 16:20   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-16 16:20 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Kirsher, Jeffrey T, David S. Miller, Kwan, Ngai-mint,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, Jan 16, 2018 at 5:12 PM, Keller, Jacob E
<jacob.e.keller@intel.com> wrote:
>> -----Original Message-----
>> From: Arnd Bergmann [mailto:arnd@arndb.de]
>> Sent: Tuesday, January 16, 2018 1:14 AM
>> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
>> Cc: Arnd Bergmann <arnd@arndb.de>; Keller, Jacob E
>> <jacob.e.keller@intel.com>; David S. Miller <davem@davemloft.net>; Kwan,
>> Ngai-mint <ngai-mint.kwan@intel.com>; intel-wired-lan@lists.osuosl.org;
>> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
>> Subject: [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused
>>
>> A cleanup of the PM code left an incorrect #ifdef in place, leading
>> to a harmless build warning:
>>
>> drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2502:12: error: 'fm10k_suspend'
>> defined but not used [-Werror=unused-function]
>> drivers/net/ethernet/intel/fm10k/fm10k_pci.c:2475:12: error: 'fm10k_resume'
>> defined but not used [-Werror=unused-function]
>>
>> It's easier to use __maybe_unused attributes here, since you
>> can't pick the wrong one.
>>
>> Fixes: 8249c47c6ba4 ("fm10k: use generic PM hooks instead of legacy PCIe power
>> hooks")
>> Acked-by: Jacob Keller <jacob.e.keller@intel.com>
>> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>> Apparently nobody picked this up the first time around (Oct 2017),
>> here is the same patch again.
>
> Odd. I remember seeing this and thought I ack'd it..? Guess it got missed.
>
> Acked-by: Jacob Keller <jacob.e.keller@intel.com>

Yes, you did give an Ack (see above), it's just that it didn't make it
into the tree for some reason. Maybe Jeff assumed you would
forward it to him and you thought that he would pick it up from the
list?

      Arnd

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

end of thread, other threads:[~2018-01-16 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16  9:14 [PATCH] [RESEND net] fm10k: mark PM functions as __maybe_unused Arnd Bergmann
2018-01-16 16:12 ` Keller, Jacob E
2018-01-16 16:20   ` Arnd Bergmann

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).