Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] For the ctucanfd glue drivers, the commit message's claim that
the conversion "reduces kernel size in case CONFIG_PM or…
--
can: convert to DEFINE_SIMPLE_DEV_PM_OPS()
This converts seven CAN drivers from SIMPLE_DEV_PM_OPS() to
DEFINE_SIMPLE_DEV_PM_OPS() and wraps the .pm pointers in pm_sleep_ptr().
It also drops the __maybe_unused annotations from the suspend and resume
callbacks.
Link: https://patch.msgid.link/20260822074701.22856-1-triet.hoang.dev@gmail.com (local)
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/can/ctucanfd/ctucanfd.h b/drivers/net/can/ctucanfd/ctucanfd.h
index 0e9904f6a05d6..7dcd7dc507e49 100644
--- a/drivers/net/can/ctucanfd/ctucanfd.h
+++ b/drivers/net/can/ctucanfd/ctucanfd.h
@@ -76,7 +76,7 @@ int ctucan_probe_common(struct device *dev, void __iomem *addr,
void (*set_drvdata_fnc)(struct device *dev,
struct net_device *ndev));
-int ctucan_suspend(struct device *dev) __maybe_unused;
-int ctucan_resume(struct device *dev) __maybe_unused;
+int ctucan_suspend(struct device *dev);
+int ctucan_resume(struct device *dev);
[Severity: Low]
This isn't a bug, but does the size reduction in the commit message hold
for the ctucanfd drivers?
"also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is
disabled."
ctucan_suspend() and ctucan_resume() are global functions in
ctucanfd_base.c. They are exported with no CONFIG_PM_SLEEP guard:
drivers/net/can/ctucanfd/ctucanfd_base.c:
int ctucan_suspend(struct device *dev)
{
...
}
EXPORT_SYMBOL(ctucan_suspend);
int ctucan_resume(struct device *dev)
{
...
}
EXPORT_SYMBOL(ctucan_resume);
With CONFIG_PM_SLEEP=n, pm_sleep_ptr() only lets the compiler drop the
static ctucan_pci_pm_ops and ctucan_platform_pm_ops structs. The callback
bodies and their export entries are still built and linked.
The __maybe_unused removal in this header also has no effect.
-Wunused-function does not warn about non-static functions, so the
attribute was not suppressing anything here.
To get the saving for ctucanfd, could the base module export the PM ops
instead, for example with EXPORT_SIMPLE_DEV_PM_OPS() or
EXPORT_GPL_SIMPLE_DEV_PM_OPS() in ctucanfd_base.c, and have the glue
drivers use pm_sleep_ptr() on that? Alternatively, the commit message
could say that the claim does not apply to ctucanfd.
No later patch in the series touches drivers/net/can/ctucanfd/, so this
is still the case at the end of the series.
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/can/ctucanfd/ctucanfd_pci.c b/drivers/net/can/ctucanfd/ctucanfd_pci.c
index 4b6db28f7b670..9c9c41c3058c0 100644
--- a/drivers/net/can/ctucanfd/ctucanfd_pci.c
+++ b/drivers/net/can/ctucanfd/ctucanfd_pci.c
@@ -259,7 +259,7 @@ static void ctucan_pci_remove(struct pci_dev *pdev)
kfree(bdata);
}
-static SIMPLE_DEV_PM_OPS(ctucan_pci_pm_ops, ctucan_suspend, ctucan_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ctucan_pci_pm_ops, ctucan_suspend, ctucan_resume);
[ ... ]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/can/ctucanfd/ctucanfd_platform.c b/drivers/net/can/ctucanfd/ctucanfd_platform.c
index 70e2577c85416..4962b00ee8ac0 100644
--- a/drivers/net/can/ctucanfd/ctucanfd_platform.c
+++ b/drivers/net/can/ctucanfd/ctucanfd_platform.c
@@ -99,7 +99,7 @@ static void ctucan_platform_remove(struct platform_device *pdev)
free_candev(ndev);
}
-static SIMPLE_DEV_PM_OPS(ctucan_platform_pm_ops, ctucan_suspend, ctucan_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ctucan_platform_pm_ops, ctucan_suspend, ctucan_resume);
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118092955.1283165-2-mkl%40pengutronix.de