lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue,  2 Sep 2014 03:36:56 -0600
From:	Jean Sacren <sakiwit@...il.com>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:	linux.nics@...el.com, e1000-devel@...ts.sourceforge.net,
	netdev@...r.kernel.org
Subject: [PATCH net-next 6/6] i40evf: remove the boilerplate of i40evf module for init/exit

Use module_pci_driver() to simplify i40evf driver module init/exit
routine.

After the change, the basic driver info doesn't print unless the
pertinent hardware is present. Printing such info generally
pronounces the presence of the hardware and it should be part of the
probe routine. Blindly printing not only clutters the console, but
also incurs unnecessary confusion.

Signed-off-by: Jean Sacren <sakiwit@...il.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 37 ++++---------------------
 1 file changed, 5 insertions(+), 32 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 38429fae4fcf..e577b1c6dcab 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2255,6 +2255,10 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct i40e_hw *hw = NULL;
 	int err;
 
+	pr_info_once("i40evf: %s - version %s\n",
+		     i40evf_driver_string, i40evf_driver_version);
+	pr_info_once("%s\n", i40evf_copyright);
+
 	err = pci_enable_device(pdev);
 	if (err)
 		return err;
@@ -2491,37 +2495,6 @@ static struct pci_driver i40evf_driver = {
 	.shutdown = i40evf_shutdown,
 };
 
-/**
- * i40e_init_module - Driver Registration Routine
- *
- * i40e_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init i40evf_init_module(void)
-{
-	int ret;
-	pr_info("i40evf: %s - version %s\n", i40evf_driver_string,
-	       i40evf_driver_version);
-
-	pr_info("%s\n", i40evf_copyright);
-
-	ret = pci_register_driver(&i40evf_driver);
-	return ret;
-}
-
-module_init(i40evf_init_module);
-
-/**
- * i40e_exit_module - Driver Exit Cleanup Routine
- *
- * i40e_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit i40evf_exit_module(void)
-{
-	pci_unregister_driver(&i40evf_driver);
-}
-
-module_exit(i40evf_exit_module);
+module_pci_driver(i40evf_driver);
 
 /* i40evf_main.c */
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ