* [PATCH] net :ethernet : replace cleanup_module with __exit()
@ 2025-10-16 11:51 Shi Hao
2025-10-16 16:49 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Shi Hao @ 2025-10-16 11:51 UTC (permalink / raw)
To: netdev; +Cc: andrew+netdev, davem, edumazet, kuba, Shi Hao
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);
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net :ethernet : replace cleanup_module with __exit()
2025-10-16 11:51 [PATCH] net :ethernet : replace cleanup_module with __exit() Shi Hao
@ 2025-10-16 16:49 ` Simon Horman
2025-10-17 2:48 ` kernel test robot
2025-10-17 13:46 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-10-16 16:49 UTC (permalink / raw)
To: Shi Hao; +Cc: netdev, andrew+netdev, davem, edumazet, kuba
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net :ethernet : replace cleanup_module with __exit()
2025-10-16 11:51 [PATCH] net :ethernet : replace cleanup_module with __exit() Shi Hao
2025-10-16 16:49 ` Simon Horman
@ 2025-10-17 2:48 ` kernel test robot
2025-10-17 13:46 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-10-17 2:48 UTC (permalink / raw)
To: Shi Hao, netdev
Cc: llvm, oe-kbuild-all, andrew+netdev, davem, edumazet, kuba,
Shi Hao
Hi Shi,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on horms-ipvs/master v6.18-rc1 next-20251016]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Shi-Hao/net-ethernet-replace-cleanup_module-with-__exit/20251016-195352
base: linus/master
patch link: https://lore.kernel.org/r/20251016115113.43986-1-i.shihao.999%40gmail.com
patch subject: [PATCH] net :ethernet : replace cleanup_module with __exit()
config: i386-randconfig-002-20251017 (https://download.01.org/0day-ci/archive/20251017/202510171007.xaD8Yz39-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251017/202510171007.xaD8Yz39-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510171007.xaD8Yz39-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/ethernet/3com/3c515.c:478:13: warning: variable 'pnp_cards' set but not used [-Wunused-but-set-variable]
478 | static int pnp_cards;
| ^
>> drivers/net/ethernet/3com/3c515.c:1552:22: error: use of undeclared identifier 'root_corkscrew_dev'
1552 | while (!list_empty(&root_corkscrew_dev)) {
| ^
drivers/net/ethernet/3com/3c515.c:1556:19: error: use of undeclared identifier 'root_corkscrew_dev'
1556 | vp = list_entry(root_corkscrew_dev.next,
| ^
drivers/net/ethernet/3com/3c515.c:1556:19: error: use of undeclared identifier 'root_corkscrew_dev'
drivers/net/ethernet/3com/3c515.c:1556:19: error: use of undeclared identifier 'root_corkscrew_dev'
1 warning and 4 errors generated.
vim +/root_corkscrew_dev +1552 drivers/net/ethernet/3com/3c515.c
^1da177e4c3f415 drivers/net/3c515.c Linus Torvalds 2005-04-16 1549
c244e2488b92ba8 drivers/net/ethernet/3com/3c515.c Shi Hao 2025-10-16 1550 static void __exit corkscrew_exit_module(void)
^1da177e4c3f415 drivers/net/3c515.c Linus Torvalds 2005-04-16 1551 {
^1da177e4c3f415 drivers/net/3c515.c Linus Torvalds 2005-04-16 @1552 while (!list_empty(&root_corkscrew_dev)) {
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net :ethernet : replace cleanup_module with __exit()
2025-10-16 11:51 [PATCH] net :ethernet : replace cleanup_module with __exit() Shi Hao
2025-10-16 16:49 ` Simon Horman
2025-10-17 2:48 ` kernel test robot
@ 2025-10-17 13:46 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-10-17 13:46 UTC (permalink / raw)
To: Shi Hao, netdev
Cc: oe-kbuild-all, andrew+netdev, davem, edumazet, kuba, Shi Hao
Hi Shi,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on horms-ipvs/master v6.18-rc1 next-20251016]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Shi-Hao/net-ethernet-replace-cleanup_module-with-__exit/20251016-195352
base: linus/master
patch link: https://lore.kernel.org/r/20251016115113.43986-1-i.shihao.999%40gmail.com
patch subject: [PATCH] net :ethernet : replace cleanup_module with __exit()
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20251017/202510172108.zGZR9d2O-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251017/202510172108.zGZR9d2O-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510172108.zGZR9d2O-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/ethernet/3com/3c515.c: In function 'corkscrew_exit_module':
>> drivers/net/ethernet/3com/3c515.c:1552:29: error: 'root_corkscrew_dev' undeclared (first use in this function)
1552 | while (!list_empty(&root_corkscrew_dev)) {
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/3com/3c515.c:1552:29: note: each undeclared identifier is reported only once for each function it appears in
In file included from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/module.h:12,
from drivers/net/ethernet/3com/3c515.c:52:
include/linux/compiler_types.h:532:27: error: expression in static assertion is not an integer
532 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:21:9: note: in expansion of macro 'static_assert'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:21:23: note: in expansion of macro '__same_type'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
include/linux/list.h:609:9: note: in expansion of macro 'container_of'
609 | container_of(ptr, type, member)
| ^~~~~~~~~~~~
drivers/net/ethernet/3com/3c515.c:1556:22: note: in expansion of macro 'list_entry'
1556 | vp = list_entry(root_corkscrew_dev.next,
| ^~~~~~~~~~
vim +/root_corkscrew_dev +1552 drivers/net/ethernet/3com/3c515.c
^1da177e4c3f415 drivers/net/3c515.c Linus Torvalds 2005-04-16 1549
c244e2488b92ba8 drivers/net/ethernet/3com/3c515.c Shi Hao 2025-10-16 1550 static void __exit corkscrew_exit_module(void)
^1da177e4c3f415 drivers/net/3c515.c Linus Torvalds 2005-04-16 1551 {
^1da177e4c3f415 drivers/net/3c515.c Linus Torvalds 2005-04-16 @1552 while (!list_empty(&root_corkscrew_dev)) {
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-17 13:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16 11:51 [PATCH] net :ethernet : replace cleanup_module with __exit() Shi Hao
2025-10-16 16:49 ` Simon Horman
2025-10-17 2:48 ` kernel test robot
2025-10-17 13:46 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).