All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Shi Hao <i.shihao.999@gmail.com>
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Subject: Re: [PATCH] net :ethernet : replace cleanup_module with __exit()
Date: Thu, 16 Oct 2025 17:49:54 +0100	[thread overview]
Message-ID: <aPEiMgvd2QM59nvu@horms.kernel.org> (raw)
In-Reply-To: <20251016115113.43986-1-i.shihao.999@gmail.com>

On Thu, Oct 16, 2025 at 05:21:13PM +0530, Shi Hao wrote:
> update old legacy cleanup_module function from the file
> with __exit module as per kernel code practices.
> 
> The file had an old cleanup_module function still in use
> which could be updated with __exit function all though its
> init_module is indeed newer however the cleanup_module
> was still using the older version of exit.
> 
> To set proper exit module function replace cleanup_module
> with __exit() corkscrew_exit_module to align it to the
> kernel code consistency.
> 
> Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
> ---
>  drivers/net/ethernet/3com/3c515.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/3com/3c515.c b/drivers/net/ethernet/3com/3c515.c
> index ecdea58e6a21..4f8cd5a6ee68 100644
> --- a/drivers/net/ethernet/3com/3c515.c
> +++ b/drivers/net/ethernet/3com/3c515.c
> @@ -1547,9 +1547,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
>  	.set_msglevel		= netdev_set_msglevel,
>  };
> 
> -
> -#ifdef MODULE
> -void cleanup_module(void)
> +static void __exit corkscrew_exit_module(void)
>  {
>  	while (!list_empty(&root_corkscrew_dev)) {
>  		struct net_device *dev;
> @@ -1563,4 +1561,4 @@ void cleanup_module(void)
>  		free_netdev(dev);
>  	}
>  }
> -#endif				/* MODULE */
> +module_exit(corkscrew_exit_module);

Hi Shi Hao,

Thanks for your patch.

Unfortunately this does not compile as a built-in because
is only defined (and initialised) when this driver is configured as a module.

I was able to verify this using a configuration generated like this:

ARCH=arm make footbridge_defconfig
echo "CONFIG_3C515=y" >> .config
ARCH=arm make oldconfig

And building using the GCC 15.2.0 toolchain available here
https://mirrors.edge.kernel.org/pub/tools/crosstool/


Also, looking at git history, I think that '3c515:' would be an
appropriate prefix for this patch.

Subject: [PATCH net-next v2] 3c515: ...


And if you do post an update, please be sure to observe the 24h rule.
https://docs.kernel.org/process/maintainer-netdev.html

Thanks!

-- 
pw-bot: changes-requested

  reply	other threads:[~2025-10-16 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 11:51 [PATCH] net :ethernet : replace cleanup_module with __exit() Shi Hao
2025-10-16 16:49 ` Simon Horman [this message]
2025-10-17  2:48 ` kernel test robot
2025-10-17 13:46 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aPEiMgvd2QM59nvu@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=i.shihao.999@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.