diff mbox series

igb: Define igb_pm_ops conditionally on CONFIG_PM

Message ID 20230428200009.2224348-1-trix@redhat.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series igb: Define igb_pm_ops conditionally on CONFIG_PM | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

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