diff mbox series

igb: Define igb_pm_ops conditionally on CONFIG_PM

Message ID 20230428200009.2224348-1-trix@redhat.com
State Accepted
Delegated to: Anthony Nguyen
Headers show
Series igb: Define igb_pm_ops conditionally on CONFIG_PM | expand

Commit Message

Tom Rix April 28, 2023, 8 p.m. UTC
For s390, gcc with W=1 reports
drivers/net/ethernet/intel/igb/igb_main.c:186:32: error:
  'igb_pm_ops' defined but not used [-Werror=unused-const-variable=]
  186 | static const struct dev_pm_ops igb_pm_ops = {
      |                                ^~~~~~~~~~

The only use of igb_pm_ops is conditional on CONFIG_PM.
The definition of igb_pm_ops should also be conditional on CONFIG_PM

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Horman May 2, 2023, 11:28 a.m. UTC | #1
On Fri, Apr 28, 2023 at 04:00:09PM -0400, Tom Rix wrote:
> For s390, gcc with W=1 reports
> drivers/net/ethernet/intel/igb/igb_main.c:186:32: error:
>   'igb_pm_ops' defined but not used [-Werror=unused-const-variable=]
>   186 | static const struct dev_pm_ops igb_pm_ops = {
>       |                                ^~~~~~~~~~
> 
> The only use of igb_pm_ops is conditional on CONFIG_PM.
> The definition of igb_pm_ops should also be conditional on CONFIG_PM
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Pucha, HimasekharX Reddy May 3, 2023, 8:57 a.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Rix, Tom
> Sent: Saturday, April 29, 2023 1:30 AM
> To: Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com
> Cc: netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org; linux-kernel@vger.kernel.org; Rix, Tom <trix@redhat.com>
> Subject: [Intel-wired-lan] [PATCH] igb: Define igb_pm_ops conditionally on CONFIG_PM
> 
> For s390, gcc with W=1 reports
> drivers/net/ethernet/intel/igb/igb_main.c:186:32: error:
>  'igb_pm_ops' defined but not used [-Werror=unused-const-variable=]
>  186 | static const struct dev_pm_ops igb_pm_ops = {
>          |                                ^~~~~~~~~~
>
> The only use of igb_pm_ops is conditional on CONFIG_PM.
> The definition of igb_pm_ops should also be conditional on CONFIG_PM
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
> 1 file changed, 2 insertions(+)
>

Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 58872a4c2540..c5cdb880774d 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -183,11 +183,13 @@  static int igb_resume(struct device *);
 static int igb_runtime_suspend(struct device *dev);
 static int igb_runtime_resume(struct device *dev);
 static int igb_runtime_idle(struct device *dev);
+#ifdef CONFIG_PM
 static const struct dev_pm_ops igb_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume)
 	SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume,
 			igb_runtime_idle)
 };
+#endif
 static void igb_shutdown(struct pci_dev *);
 static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
 #ifdef CONFIG_IGB_DCA