* [PATCH net-next] ice: mark PM functions as __maybe_unused
@ 2020-07-28 1:41 Wei Yongjun
2020-07-29 17:14 ` [Intel-wired-lan] " Bowers, AndrewX
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-07-28 1:41 UTC (permalink / raw)
To: Hulk Robot, Jeff Kirsher, Jakub Kicinski, Alexei Starovoitov,
Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
Akeem G Abodunrin
Cc: Wei Yongjun, intel-wired-lan, netdev
In certain configurations without power management support, the
following warnings happen:
drivers/net/ethernet/intel/ice/ice_main.c:4214:12: warning:
'ice_resume' defined but not used [-Wunused-function]
4214 | static int ice_resume(struct device *dev)
| ^~~~~~~~~~
drivers/net/ethernet/intel/ice/ice_main.c:4150:12: warning:
'ice_suspend' defined but not used [-Wunused-function]
4150 | static int ice_suspend(struct device *dev)
| ^~~~~~~~~~~
Mark these functions as __maybe_unused to make it clear to the
compiler that this is going to happen based on the configuration,
which is the standard for these types of functions.
Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d6981ba34b27..6edf018c4940 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4147,7 +4147,7 @@ static int ice_reinit_interrupt_scheme(struct ice_pf *pf)
* Power Management callback to quiesce the device and prepare
* for D3 transition.
*/
-static int ice_suspend(struct device *dev)
+static int __maybe_unused ice_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct ice_pf *pf;
@@ -4211,7 +4211,7 @@ static int ice_suspend(struct device *dev)
* ice_resume - PM callback for waking up from D3
* @dev: generic device information structure
*/
-static int ice_resume(struct device *dev)
+static int __maybe_unused ice_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
enum ice_reset_req reset_type;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [Intel-wired-lan] [PATCH net-next] ice: mark PM functions as __maybe_unused
2020-07-28 1:41 [PATCH net-next] ice: mark PM functions as __maybe_unused Wei Yongjun
@ 2020-07-29 17:14 ` Bowers, AndrewX
0 siblings, 0 replies; 2+ messages in thread
From: Bowers, AndrewX @ 2020-07-29 17:14 UTC (permalink / raw)
To: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Wei Yongjun
> Sent: Monday, July 27, 2020 6:42 PM
> To: Hulk Robot <hulkci@huawei.com>; Kirsher, Jeffrey T
> <jeffrey.t.kirsher@intel.com>; Jakub Kicinski <kuba@kernel.org>; Alexei
> Starovoitov <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>;
> Jesper Dangaard Brouer <hawk@kernel.org>; John Fastabend
> <john.fastabend@gmail.com>; Abodunrin, Akeem G
> <akeem.g.abodunrin@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; Wei Yongjun
> <weiyongjun1@huawei.com>; netdev@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH net-next] ice: mark PM functions as
> __maybe_unused
>
> In certain configurations without power management support, the following
> warnings happen:
>
> drivers/net/ethernet/intel/ice/ice_main.c:4214:12: warning:
> 'ice_resume' defined but not used [-Wunused-function]
> 4214 | static int ice_resume(struct device *dev)
> | ^~~~~~~~~~
> drivers/net/ethernet/intel/ice/ice_main.c:4150:12: warning:
> 'ice_suspend' defined but not used [-Wunused-function]
> 4150 | static int ice_suspend(struct device *dev)
> | ^~~~~~~~~~~
>
> Mark these functions as __maybe_unused to make it clear to the compiler
> that this is going to happen based on the configuration, which is the standard
> for these types of functions.
>
> Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-29 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-28 1:41 [PATCH net-next] ice: mark PM functions as __maybe_unused Wei Yongjun
2020-07-29 17:14 ` [Intel-wired-lan] " Bowers, AndrewX
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).