Skip to contentSkip to conversation

net: ethernet: dlink: replace deprecated macro

PATCH In review Moon Yeounsu 3 participants 3 messages Aug 10, 2024 – Aug 16, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: dlink: replace deprecated macro

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),
};
---
 drivers/net/ethernet/dlink/dl2k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/dlink/dl2k.c +1 -1
index 7bfeae04b52b..d0ea92607870 100644
@@ -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

--
2.46.0

reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 32 lines · Moon Yeounsu

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),
};
Quoted 1 line

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.

maintainer
#2 lore raw
In reply to Moon Yeounsu
Quoted 6 lines · 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!