netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Eli Cohen <eli@mellanox.com>, Leon Romanovsky <leon@kernel.org>,
	linux-rdma@vger.kernel.org, Ira Weiny <ira.weiny@intel.com>,
	Leon Romanovsky <leonro@nvidia.com>
Subject: [net 10/10] net: mlx5: eliminate anonymous module_init & module_exit
Date: Wed, 18 Jan 2023 00:04:14 -0800	[thread overview]
Message-ID: <20230118080414.77902-11-saeed@kernel.org> (raw)
In-Reply-To: <20230118080414.77902-1-saeed@kernel.org>

From: Randy Dunlap <rdunlap@infradead.org>

Eliminate anonymous module_init() and module_exit(), which can lead to
confusion or ambiguity when reading System.map, crashes/oops/bugs,
or an initcall_debug log.

Give each of these init and exit functions unique driver-specific
names to eliminate the anonymous names.

Example 1: (System.map)
 ffffffff832fc78c t init
 ffffffff832fc79e t init
 ffffffff832fc8f8 t init

Example 2: (initcall_debug log)
 calling  init+0x0/0x12 @ 1
 initcall init+0x0/0x12 returned 0 after 15 usecs
 calling  init+0x0/0x60 @ 1
 initcall init+0x0/0x60 returned 0 after 2 usecs
 calling  init+0x0/0x9a @ 1
 initcall init+0x0/0x9a returned 0 after 74 usecs

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Eli Cohen <eli@mellanox.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index df134f6d32dc..3d5f2a4b1fed 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -2098,7 +2098,7 @@ static void mlx5_core_verify_params(void)
 	}
 }
 
-static int __init init(void)
+static int __init mlx5_init(void)
 {
 	int err;
 
@@ -2133,7 +2133,7 @@ static int __init init(void)
 	return err;
 }
 
-static void __exit cleanup(void)
+static void __exit mlx5_cleanup(void)
 {
 	mlx5e_cleanup();
 	mlx5_sf_driver_unregister();
@@ -2141,5 +2141,5 @@ static void __exit cleanup(void)
 	mlx5_unregister_debugfs();
 }
 
-module_init(init);
-module_exit(cleanup);
+module_init(mlx5_init);
+module_exit(mlx5_cleanup);
-- 
2.39.0


  parent reply	other threads:[~2023-01-18  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  8:04 [pull request][net 00/10] mlx5 fixes 2023-01-18 Saeed Mahameed
2023-01-18  8:04 ` [net 01/10] net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work() Saeed Mahameed
2023-01-19 14:50   ` patchwork-bot+netdevbpf
2023-01-18  8:04 ` [net 02/10] net/mlx5e: Avoid false lock dependency warning on tc_ht even more Saeed Mahameed
2023-01-18  8:04 ` [net 03/10] net/mlx5e: Remove redundant xsk pointer check in mlx5e_mpwrq_validate_xsk Saeed Mahameed
2023-01-18  8:04 ` [net 04/10] net/mlx5: E-switch, Fix setting of reserved fields on MODIFY_SCHEDULING_ELEMENT Saeed Mahameed
2023-01-18  8:04 ` [net 05/10] net/mlx5e: QoS, Fix wrongfully setting parent_element_id " Saeed Mahameed
2023-01-18  8:04 ` [net 06/10] net/mlx5e: Set decap action based on attr for sample Saeed Mahameed
2023-01-18  8:04 ` [net 07/10] net/mlx5e: Remove optimization which prevented update of ESN state Saeed Mahameed
2023-01-18  8:04 ` [net 08/10] net/mlx5e: Protect global IPsec ASO Saeed Mahameed
2023-01-18  8:04 ` [net 09/10] net/mlx5: E-switch, Fix switchdev mode after devlink reload Saeed Mahameed
2023-01-18  8:04 ` Saeed Mahameed [this message]
2023-01-19  4:55 ` [pull request][net 00/10] mlx5 fixes 2023-01-18 Jakub Kicinski

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=20230118080414.77902-11-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eli@mellanox.com \
    --cc=ira.weiny@intel.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /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 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).