Article View: linux.kernel.netdev
Article #19078Re: [PATCH net-next 04/12] can: convert to DEFINE_SIMPLE_DEV_PM_OPS()
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 09:54
Date: Thu, 19 Nov 2026 09:54
102 lines
11624 bytes
11624 bytes
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
> 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.
> 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);
[ ... ]
> 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
Technical Details
Message-ID:
<179508206819.3136.5143765579402417874@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366916-linux-kernel-netdev=dewy.ruReferences:
<20261118092955.1283165-5-mkl@pengutronix.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366916-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 04/12] can: convert to DEFINE_SIMPLE_DEV_PM_OPS() Date: Thu, 19 Nov 2026 09:54:28 +0000 Organization: Usenet Network Message-ID: <179508206819.3136.5143765579402417874@kernel.org> References: <20261118092955.1283165-5-mkl@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2842292"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:61nDx0zqUsOVgJto7LRoVsBPfNY= sha256:aeZCcqqzAqMteQ7xTD/t79hvpcPM1634/rOcdMlwdzI= sha1:77SV9kzjA0JH7pYjQlLww0PFdhw= sha256:K9qi2HxWR0chnttPJMhZSvmkCik0ICDezv0C6dFjC3U= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id AC9901155A8; Thu, 19 Nov 2026 12:54:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.5 X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id auKdR4fzM4ep; Thu, 19 Nov 2026 12:54:42 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366916-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E7A381155A1; Thu, 19 Nov 2026 12:54:33 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id EABF9225F6D; Thu, 19 Nov 2026 09:54:30 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795082070; b=ypa22zECU/l7C0s5oLshvWe+2ISv0WnM581spvimuAtoImf5AJHkuomyXZ/0bg7LuaSM w13fgZUN4H5BVkW9mLA73fS2ISjBQQipqmCZ090zUpcl0cHLqfiyd/34O44kD2r4vvzWv i6Drg1h2YniR28Uo9MZ4p4N3w6JyWduoCwQqxS8k0ok4KPzh6vKd0aJOO/QEu+ut1aawO GJyBCmt+xuzC4NA72PE7Ul5vK62TjzNFRJlACOcPPEp3uh/YGqtAF9mLXD9xqAK5C6MYL G3O44sogcdMNO+2aLLqOupdkb8y/ltJrf80GKFhpQyStnCISMYA4QA/lAJeXNKGGRyw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795082070; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=obGBpySIvx6emk3zOnHCrpwW6BEFOnCL9XiX5vLr8nw=; b=E10Q3nfBHMNRQLysnXBxGwAumTehIC8S0jhK0e2A+ni1OzrB0XuV21ZL7vvtgqVAPUzi PIi7ztmJWiyi0z2e8+kxBBo6kHVQA4Pzw3Ojeaja8M4Udq7/Or74NV36GSKkNCu+hKli4 lgd+sVBU/8/gi/tlsQLSBsKsXzOzQR+FfX/RFQ8bZHnH0DgrGWtkAeGwuhlDXFIaO8AEA uVxAojAybc6AaV1sCZ2zPN2MFBHIYjbT/cwgIMODmycGpGvabkydzT7fGmGiuXTm1Naat bEKg9lwzcDVNwiGE3ZwaiCbUwP/hnpDkERvIdigvQK/1YGS2xy3xjRJVPbvg/HF/rEw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="ddP/n2PA"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BACE606A332; Thu, 19 Nov 2026 09:54:30 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ddP/n2PA X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795082069; b=knD1jHWhNtikUriW/xOrlE1tf4efDDZtQuIEHjLihwdIN9xJbMY+S9btw0DT8+ROa5R1 yY7ZDeStERBkKs6nHHp6poYDxsxKhg5KTcvpXhkgR98q6uVYxixSmMVlo8GkYbFPDdbMY O3Kg9gXGJeZ5Okm2su8qhLwdK/nzdiW9l1Np9y9RF0OidyrHDHA/8sUBO1Lhmj3uYYamE p7J3HiTBhN8mQtEW2LgnmXnUEMOvzO2NrQI6S/J/ZTFOXqzq2gcYWp/kP1+w+ExLYP4RV YibRQSpzKRjSWs3LMTSi3pD4duMLRokNpn6YraIjBG9FFDae0qRk+Gm+lY7jMmttoiw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795082069; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=obGBpySIvx6emk3zOnHCrpwW6BEFOnCL9XiX5vLr8nw=; b=C/Wh7XRmL7Se9xG4J77b4vnjqKWECBapVkvhmRk2hEd02pxFX/e9NhEdyZtMbKiCAvV8 ArrSwWNWrw7nMhLDwELOJs2aobh2mnvoZLsDw7Zz6lgFdyxj5GsKROHiiQ9k7hZvjvoJA 9mZHC82WKbc35jhm0gNEtq7s0+kZX1NzBzAw+3Rx3/FX4vyPECo0a+7kyDpNDqScyoUpr SC8I6lMSDwZ6cUs5NQl9U49C5iB/CtIxkR8C/4zJT8uXx+jeHkXZimO6JAFx+ba8YlKEa LsFmuan/k0QVKeVmtNkXwc5zahpg59isFlEeg6tVYrxS3JF8bJ/Bt5h3QKv3bS/V4uQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="ddP/n2PA"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69B18606A320; Thu, 19 Nov 2026 09:54:29 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95E881F000CA; Thu, 19 Nov 2026 09:54:28 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795082069; bh=obGBpySIvx6emk3zOnHCrpwW6BEFOnCL9XiX5vLr8nw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ddP/n2PA7NfcaZCgedOYThStDr74AP3H6ZJ6NvmdzvQy/O+XEklszTupmJm631wyE IWFpdX+CYG+WG2wU3uX42DqY/nIPlGCbbGbxUwttubikIdD42IfNBuYBWBMCwwmxbe WjWSEN7Tfs57f5QP/PPjHhjrlJdyR0ueIWHWHQnAHOCr+AAm2pwbciPUDituIBmquX PJPtxXswZTePeANUrJnaIi4t+q83qzg549/Vc43T+a5RPnVQaBUa4E9cAl+FGdtFKR LZk5PDIxTSqS1PEb5j6vcM6DDOSYmrkh1LZMiraflqZXQfhV45/nkbXcdriNJcSa5J P6YjjBgH0ZzgQ== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, kernel@pengutronix.de, socketcan@hartkopp.net, dev.kurt@vandijck-laurijssen.be X-In-Reply-To: <20261118092955.1283165-5-mkl@pengutronix.de> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list