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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1280588752-9340-27-git-send-email-khc@pm.waw.pl>
Date:	Sat, 31 Jul 2010 17:05:50 +0200
From:	Krzysztof Halasa <khc@...waw.pl>
To:	David Miller <davem@...emloft.net>
Cc:	<netdev@...r.kernel.org>
Subject: [PATCH 27/29] LMC: Remove redundant card->name.

From: Krzysztof Hałasa <khc@...waw.pl>

Signed-off-by: Krzysztof Hałasa <khc@...waw.pl>
---
 drivers/net/wan/lmc/main.c  |    3 +--
 drivers/net/wan/lmc/media.c |   40 ++++++++++++++++++++++------------------
 drivers/net/wan/lmc/var.h   |    1 -
 3 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wan/lmc/main.c b/drivers/net/wan/lmc/main.c
index 133cc77..13383a5 100644
--- a/drivers/net/wan/lmc/main.c
+++ b/drivers/net/wan/lmc/main.c
@@ -754,7 +754,6 @@ static int __devinit lmc_init_one(struct pci_dev *pdev,
 	dev->watchdog_timeo = HZ; /* 1 second */
 	dev->tx_queue_len = 100;
 	sc->netdev = dev;
-	sc->name = dev->name;
 	dev->base_addr = pci_resource_start(pdev, 0);
 	dev->irq = pdev->irq;
 	pci_set_drvdata(pdev, dev);
@@ -1624,7 +1623,7 @@ static void lmc_softreset(struct card * const sc)
 			if (skb == NULL) {
 				printk(KERN_WARNING
 				       "%s: Failed to allocate receiver ring, will try again\n",
-				       sc->name);
+				       sc->netdev->name);
 				sc->failed_ring = 1;
 				break;
 			} else
diff --git a/drivers/net/wan/lmc/media.c b/drivers/net/wan/lmc/media.c
index ea5c2bc..b9fadb4 100644
--- a/drivers/net/wan/lmc/media.c
+++ b/drivers/net/wan/lmc/media.c
@@ -230,13 +230,14 @@ static int lmc_ssi_get_link_status(struct card * const sc)
 		if (sc->last_led_err[3] != 1) {
 			sc->extra_stats.tx_lossOfClockCnt++;
 			printk(KERN_WARNING "%s: Lost Clock, Link Down\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		sc->last_led_err[3] = 1;
 		lmc_led_on(sc, LMC_MII16_LED3);	/* turn ON red LED */
 	} else {
 		if (sc->last_led_err[3] == 1)
-			printk(KERN_WARNING "%s: Clock Returned\n", sc->name);
+			printk(KERN_WARNING "%s: Clock Returned\n",
+			       sc->netdev->name);
 		sc->last_led_err[3] = 0;
 		lmc_led_off(sc, LMC_MII16_LED3); /* turn OFF red LED */
 	}
@@ -255,12 +256,14 @@ static int lmc_ssi_get_link_status(struct card * const sc)
 
 	if (hw_hdsk == 0) {
 		if (sc->last_led_err[1] != 1)
-			printk(KERN_WARNING "%s: DSR not asserted\n", sc->name);
+			printk(KERN_WARNING "%s: DSR not asserted\n",
+			       sc->netdev->name);
 		sc->last_led_err[1] = 1;
 		lmc_led_off(sc, LMC_MII16_LED1);
 	} else {
 		if (sc->last_led_err[1] != 0)
-			printk(KERN_WARNING "%s: DSR now asserted\n", sc->name);
+			printk(KERN_WARNING "%s: DSR now asserted\n",
+			       sc->netdev->name);
 		sc->last_led_err[1] = 0;
 		lmc_led_on(sc, LMC_MII16_LED1);
 	}
@@ -532,7 +535,7 @@ static int lmc_ds3_get_link_status(struct card * const sc)
 			lmc_mii_writereg(sc, 0, 18, r1);
 			printk(KERN_WARNING
 			       "%s: Red Alarm - Loss of Signal or Loss of Framing\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED3);	/* turn on red LED */
 		sc->last_led_err[3] = 1;
@@ -556,10 +559,11 @@ static int lmc_ds3_get_link_status(struct card * const sc)
 		ret = 0;
 		if (sc->last_led_err[0] != 1) {
 			printk(KERN_WARNING
-			       "%s: AIS Alarm or XBit Error\n", sc->name);
+			       "%s: AIS Alarm or XBit Error\n",
+			       sc->netdev->name);
 			printk(KERN_WARNING
 			       "%s: Remote end has loss of signal or framing\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED0);
 		sc->last_led_err[0] = 1;
@@ -576,7 +580,7 @@ static int lmc_ds3_get_link_status(struct card * const sc)
 		if (sc->last_led_err[1] != 1) {
 			printk(KERN_WARNING
 			       "%s: Blue Alarm - Receiving all 1's\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED1);
 		sc->last_led_err[1] = 1;
@@ -638,11 +642,11 @@ static void lmc_t1_set_circuit_type(struct card * const sc, int ie)
 	if (ie == LMC_CTL_CIRCUIT_TYPE_T1) {
 		sc->miireg16 |= LMC_MII16_T1_Z;
 		sc->ictl.circuit_type = LMC_CTL_CIRCUIT_TYPE_T1;
-		printk(KERN_INFO "%s: In T1 Mode\n", sc->name);
+		printk(KERN_INFO "%s: In T1 Mode\n", sc->netdev->name);
 	} else {
 		sc->miireg16 &= ~LMC_MII16_T1_Z;
 		sc->ictl.circuit_type = LMC_CTL_CIRCUIT_TYPE_E1;
-		printk(KERN_INFO "%s: In E1 Mode\n", sc->name);
+		printk(KERN_INFO "%s: In E1 Mode\n", sc->netdev->name);
 	}
 
 	lmc_mii_writereg(sc, 0, 16, sc->miireg16);
@@ -747,14 +751,14 @@ static int lmc_t1_get_link_status(struct card * const sc)
 		if (sc->last_led_err[1] != 1) {
 			printk(KERN_WARNING
 			       "%s: Receive AIS/Blue Alarm. Far end in RED alarm\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED1);
 		sc->last_led_err[1] = 1;
 	} else {
 		if (sc->last_led_err[1] != 0) {
 			printk(KERN_WARNING "%s: End AIS/Blue Alarm\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_off(sc, LMC_DS3_LED1);
 		sc->last_led_err[1] = 0;
@@ -770,14 +774,14 @@ static int lmc_t1_get_link_status(struct card * const sc)
 		ret = 0;
 		if (sc->last_led_err[0] != 1) {
 			printk(KERN_WARNING "%s: Receive Yellow AIS Alarm\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED0);
 		sc->last_led_err[0] = 1;
 	} else {
 		if (sc->last_led_err[0] != 0) {
 			printk(KERN_WARNING "%s: End of Yellow AIS Alarm\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_off(sc, LMC_DS3_LED0);
 		sc->last_led_err[0] = 0;
@@ -790,7 +794,7 @@ static int lmc_t1_get_link_status(struct card * const sc)
 		if (sc->last_led_err[3] != 1) {
 			printk(KERN_WARNING
 			       "%s: Local Red Alarm: Loss of Framing\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED3);
 		sc->last_led_err[3] = 1;
@@ -798,7 +802,7 @@ static int lmc_t1_get_link_status(struct card * const sc)
 	} else {
 		if (sc->last_led_err[3] != 0) {
 			printk(KERN_WARNING "%s: End Red Alarm (LOF)\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		if (!(link_status & T1F_RLOS))
 			lmc_led_off(sc, LMC_DS3_LED3);
@@ -810,7 +814,7 @@ static int lmc_t1_get_link_status(struct card * const sc)
 		if (sc->last_led_err[2] != 1) {
 			printk(KERN_WARNING
 			       "%s: Local Red Alarm: Loss of Signal\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		lmc_led_on(sc, LMC_DS3_LED3);
 		sc->last_led_err[2] = 1;
@@ -818,7 +822,7 @@ static int lmc_t1_get_link_status(struct card * const sc)
 	} else {
 		if (sc->last_led_err[2] != 0) {
 			printk(KERN_WARNING "%s: End Red Alarm (LOS)\n",
-			       sc->name);
+			       sc->netdev->name);
 		}
 		if (!(link_status & T1F_RLOF))
 			lmc_led_off(sc, LMC_DS3_LED3);
diff --git a/drivers/net/wan/lmc/var.h b/drivers/net/wan/lmc/var.h
index 54e9b0b..f62f9a1 100644
--- a/drivers/net/wan/lmc/var.h
+++ b/drivers/net/wan/lmc/var.h
@@ -268,7 +268,6 @@ typedef struct lmc_xinfo {
 
 /* forward decl */
 struct card {
-	char *name;
 	struct lmc_extra_statistics extra_stats;
 	struct net_device *netdev;
 
-- 
1.7.1.1

--
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