diff mbox series

net: ethernet: dlink: replace deprecated macro

Message ID 20240810141502.175877-1-yyyynoom@gmail.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series net: ethernet: dlink: replace deprecated macro | 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/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: andriy.shevchenko@linux.intel.com
netdev/build_clang success Errors and warnings before: 29 this patch: 29
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: 30 this patch: 30
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-10--18-00 (tests: 707)

Commit Message

Moon Yeounsu Aug. 10, 2024, 2:15 p.m. UTC
Macro `SIMPLE_DEV_PM_OPS()` is deprecated.
This patch replaces `SIMPLE_DEV_PM_OPS()` with
`DEFINE_SIMPLE_DEV_PM_OPS()` currently used.

Expanded results are the same since remaining
member is initialized as zero (NULL):

static SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
Expanded to:
static const struct dev_pm_ops __attribute__((__unused__)) rio_pm_ops = {
	.suspend = ((1) ? ((rio_suspend)) : ((void *)0)),
	.resume = ((1) ? ((rio_resume)) : ((void *)0)),
	.freeze = ((1) ? ((rio_suspend)) : ((void *)0)),
	.thaw = ((1) ? ((rio_resume)) : ((void *)0)),
	.poweroff = ((1) ? ((rio_suspend)) : ((void *)0)),
	.restore = ((1) ? ((rio_resume)) : ((void *)0)),
};

static DEFINE_SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
Expanded to:
static const struct dev_pm_ops rio_pm_ops = {
	.suspend = ((1) ? ((rio_suspend)) : ((void *)0)),
	.resume = ((1) ? ((rio_resume)) : ((void *)0)),
	.freeze = ((1) ? ((rio_suspend)) : ((void *)0)),
	.thaw = ((1) ? ((rio_resume)) : ((void *)0)),
	.poweroff = ((1) ? ((rio_suspend)) : ((void *)0)),
	.restore = ((1) ? ((rio_resume)) : ((void *)0)),
	.runtime_suspend = ((void *)0),
	.runtime_resume = ((void *)0),
	.runtime_idle = ((void *)0),
};

Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com>
---
 drivers/net/ethernet/dlink/dl2k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.46.0

Comments

Simon Horman Aug. 12, 2024, 10:47 a.m. UTC | #1
On Sat, Aug 10, 2024 at 11:15:02PM +0900, Moon Yeounsu wrote:
> Macro `SIMPLE_DEV_PM_OPS()` is deprecated.
> This patch replaces `SIMPLE_DEV_PM_OPS()` with
> `DEFINE_SIMPLE_DEV_PM_OPS()` currently used.
> 
> Expanded results are the same since remaining
> member is initialized as zero (NULL):
> 
> static SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
> Expanded to:
> static const struct dev_pm_ops __attribute__((__unused__)) rio_pm_ops = {
> 	.suspend = ((1) ? ((rio_suspend)) : ((void *)0)),
> 	.resume = ((1) ? ((rio_resume)) : ((void *)0)),
> 	.freeze = ((1) ? ((rio_suspend)) : ((void *)0)),
> 	.thaw = ((1) ? ((rio_resume)) : ((void *)0)),
> 	.poweroff = ((1) ? ((rio_suspend)) : ((void *)0)),
> 	.restore = ((1) ? ((rio_resume)) : ((void *)0)),
> };
> 
> static DEFINE_SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
> Expanded to:
> static const struct dev_pm_ops rio_pm_ops = {
> 	.suspend = ((1) ? ((rio_suspend)) : ((void *)0)),
> 	.resume = ((1) ? ((rio_resume)) : ((void *)0)),
> 	.freeze = ((1) ? ((rio_suspend)) : ((void *)0)),
> 	.thaw = ((1) ? ((rio_resume)) : ((void *)0)),
> 	.poweroff = ((1) ? ((rio_suspend)) : ((void *)0)),
> 	.restore = ((1) ? ((rio_resume)) : ((void *)0)),
> 	.runtime_suspend = ((void *)0),
> 	.runtime_resume = ((void *)0),
> 	.runtime_idle = ((void *)0),
> };
> 
> Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com>

Hi,

I don't think that there is a need to repost because of this.  But in
future, please consider explicitly targeting Networking patches at net-next
(or at net for bug fixes).

	Subject: [net-next] ...

That notwithstanding, this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>
Jakub Kicinski Aug. 16, 2024, 12:29 a.m. UTC | #2
On Sat, 10 Aug 2024 23:15:02 +0900 Moon Yeounsu wrote:
> Macro `SIMPLE_DEV_PM_OPS()` is deprecated.
> This patch replaces `SIMPLE_DEV_PM_OPS()` with
> `DEFINE_SIMPLE_DEV_PM_OPS()` currently used.
> 
> Expanded results are the same since remaining
> member is initialized as zero (NULL):

FTR this has been merged, commit 2984e69a24af ("net: ethernet: dlink:
replace deprecated macro") in net-next. Thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
index 7bfeae04b52b..d0ea92607870 100644
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -1842,7 +1842,7 @@  static int rio_resume(struct device *device)
 	return 0;
 }

-static SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rio_pm_ops, rio_suspend, rio_resume);
 #define RIO_PM_OPS    (&rio_pm_ops)

 #else