Skip to contentSkip to conversation

minor cleanups for s2io

PATCH In review John W. Linville 2 participants 4 messages Sep 28, 2005 – Oct 4, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover minor cleanups for s2io

A couple of minor cleanups for the s2io driver:

-- Use the target length as the third argument to strncpy in s2io_ethtool_gdrvinfo()

-- Add a MODULE_VERSION entry

Patches to follow...

#1 lore raw

PATCH 1/2 s2io: change strncpy length arg to use size of target

Use the size of the target array for the length argument to strncpy instead of the size of the source or a magic number.

---

 drivers/net/s2io.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/net/s2io.c +4 -5
@@ -3778,11 +3778,10 @@ static void s2io_ethtool_gdrvinfo(struct
 {
 	nic_t *sp = dev->priv;
 
-	strncpy(info->driver, s2io_driver_name, sizeof(s2io_driver_name));
-	strncpy(info->version, s2io_driver_version,
-		sizeof(s2io_driver_version));
-	strncpy(info->fw_version, "", 32);
-	strncpy(info->bus_info, pci_name(sp->pdev), 32);
+	strncpy(info->driver, s2io_driver_name, sizeof(info->driver));
+	strncpy(info->version, s2io_driver_version, sizeof(info->version));
+	strncpy(info->fw_version, "", sizeof(info->fw_version));
+	strncpy(info->bus_info, pci_name(sp->pdev), sizeof(info->bus_info));
 	info->regdump_len = XENA_REG_SPACE;
 	info->eedump_len = XENA_EEPROM_SPACE;
 	info->testinfo_len = S2IO_TEST_LEN;
#2 lore raw

PATCH 2/2 s2io: add MODULE_VERSION to s2io driver

Add a MODULE_VERSION entry for the s2io driver.

---

 drivers/net/s2io.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/s2io.c +7 -3
@@ -65,9 +65,11 @@
 #include "s2io.h"
 #include "s2io-regs.h"
 
+#define DRV_VERSION "2.0.8.1"
+
 /* S2io Driver name & version. */
 static char s2io_driver_name[] = "Neterion";
-static char s2io_driver_version[] = "Version 2.0.8.1";
+static char s2io_driver_version[] = DRV_VERSION;
 
 static inline int RXD_IS_UP2DT(RxD_t *rxdp)
 {
@@ -5227,6 +5229,8 @@ static void s2io_init_pci(nic_t * sp)
 
 MODULE_AUTHOR("Raghavendra Koushik <[email protected]>");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
+
 module_param(tx_fifo_num, int, 0);
 module_param(rx_ring_num, int, 0);
 module_param_array(tx_fifo_len, uint, NULL, 0);
@@ -5570,7 +5574,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
 	if (sp->device_type & XFRAME_II_DEVICE) {
 		DBG_PRINT(ERR_DBG, "%s: Neterion Xframe II 10GbE adapter ",
 			  dev->name);
-		DBG_PRINT(ERR_DBG, "(rev %d), %s",
+		DBG_PRINT(ERR_DBG, "(rev %d), Version %s",
 				get_xena_rev_id(sp->pdev),
 				s2io_driver_version);
 #ifdef CONFIG_2BUFF_MODE
@@ -5594,7 +5598,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
 	} else {
 		DBG_PRINT(ERR_DBG, "%s: Neterion Xframe I 10GbE adapter ",
 			  dev->name);
-		DBG_PRINT(ERR_DBG, "(rev %d), %s",
+		DBG_PRINT(ERR_DBG, "(rev %d), Version %s",
 					get_xena_rev_id(sp->pdev),
 					s2io_driver_version);
 #ifdef CONFIG_2BUFF_MODE
#3 lore raw

Re: [patch 2.6.14-rc2 2/2] s2io: add MODULE_VERSION to s2io driver

applied patches 1-2