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]
Message-Id: <1409650616-1035-5-git-send-email-sakiwit@gmail.com>
Date:	Tue,  2 Sep 2014 03:36:54 -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 4/6] igbvf: remove the boilerplate of igbvf module for init/exit

Use module_pci_driver() to simplify igbvf 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/igbvf/netdev.c | 35 +++++--------------------------
 1 file changed, 5 insertions(+), 30 deletions(-)

diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 63c807c9b21c..f3b4d7f676f1 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2630,6 +2630,10 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	static int cards_found;
 	int err, pci_using_dac;
 
+	pr_info_once("%s - version %s\n",
+		     igbvf_driver_string, igbvf_driver_version);
+	pr_info_once("%s\n", igbvf_copyright);
+
 	err = pci_enable_device_mem(pdev);
 	if (err)
 		return err;
@@ -2875,36 +2879,7 @@ static struct pci_driver igbvf_driver = {
 	.err_handler = &igbvf_err_handler
 };
 
-/**
- * igbvf_init_module - Driver Registration Routine
- *
- * igbvf_init_module is the first routine called when the driver is
- * loaded. All it does is register with the PCI subsystem.
- **/
-static int __init igbvf_init_module(void)
-{
-	int ret;
-	pr_info("%s - version %s\n", igbvf_driver_string, igbvf_driver_version);
-	pr_info("%s\n", igbvf_copyright);
-
-	ret = pci_register_driver(&igbvf_driver);
-
-	return ret;
-}
-module_init(igbvf_init_module);
-
-/**
- * igbvf_exit_module - Driver Exit Cleanup Routine
- *
- * igbvf_exit_module is called just before the driver is removed
- * from memory.
- **/
-static void __exit igbvf_exit_module(void)
-{
-	pci_unregister_driver(&igbvf_driver);
-}
-module_exit(igbvf_exit_module);
-
+module_pci_driver(igbvf_driver);
 
 MODULE_AUTHOR("Intel Corporation, <e1000-devel@...ts.sourceforge.net>");
 MODULE_DESCRIPTION("Intel(R) Gigabit Virtual Function Network Driver");
--
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