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-23-git-send-email-khc@pm.waw.pl>
Date:	Sat, 31 Jul 2010 17:05:46 +0200
From:	Krzysztof Halasa <khc@...waw.pl>
To:	David Miller <davem@...emloft.net>
Cc:	<netdev@...r.kernel.org>
Subject: [PATCH 23/29] LMC: lmc_set_protocol() is effectively a NOP, remove it.

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

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

diff --git a/drivers/net/wan/lmc/main.c b/drivers/net/wan/lmc/main.c
index 1231d7c..133cc77 100644
--- a/drivers/net/wan/lmc/main.c
+++ b/drivers/net/wan/lmc/main.c
@@ -962,7 +962,7 @@ static void lmc_running_reset(struct net_device *dev)
 
 
 /* This is what is called when you ifconfig down a device. This disables
-   the timer for the watchdog and keepalives, and disables the irq for dev. */
+   the watchdog timer and the irq for dev. */
 static int lmc_close(struct net_device *dev)
 {
 	/* not calling release_region() as we should */
diff --git a/drivers/net/wan/lmc/media.c b/drivers/net/wan/lmc/media.c
index ecf0f2a..ea5c2bc 100644
--- a/drivers/net/wan/lmc/media.c
+++ b/drivers/net/wan/lmc/media.c
@@ -35,13 +35,6 @@
  * the GNU General Public License version 2, incorporated herein by reference.
  */
 
-static void lmc_set_protocol(struct card * const sc, struct control *ctl)
-{
-	if (!ctl)
-		sc->ictl.keepalive_onoff = LMC_CTL_ON;
-}
-
-
 /* SSI methods */
 
 /* These are bits to program the ssi frequency generator */
@@ -180,7 +173,6 @@ static void lmc_ssi_set_status(struct card * const sc, struct control *ctl)
 	if (ctl == NULL) {
 		lmc_ssi_set_clock(sc, sc->ictl.clock_source);
 		lmc_ssi_set_speed(sc, &sc->ictl);
-		lmc_set_protocol(sc, NULL);
 		return;
 	}
 
@@ -197,8 +189,6 @@ static void lmc_ssi_set_status(struct card * const sc, struct control *ctl)
 
 	if (ctl->clock_rate != sc->ictl.clock_rate)
 		lmc_ssi_set_speed(sc, ctl);
-
-	lmc_set_protocol(sc, ctl);
 }
 
 /* Return hardware link status. 0 == link is down, 1 == link is up. */
@@ -375,21 +365,15 @@ static void lmc_hssi_set_status(struct card * const sc, struct control *ctl)
 {
 	if (ctl == NULL) {
 		lmc_hssi_set_clock(sc, sc->ictl.clock_source);
-		lmc_set_protocol(sc, NULL);
-
 		return;
 	}
 
 	/* check for change in clock source */
-	if (ctl->clock_source && !sc->ictl.clock_source) {
-		lmc_hssi_set_clock(sc, LMC_CTL_CLOCK_SOURCE_INT);
+	if (ctl->clock_source && !sc->ictl.clock_source)
 		sc->timing = LMC_CTL_CLOCK_SOURCE_INT;
-	} else if (!ctl->clock_source && sc->ictl.clock_source) {
+	else if (!ctl->clock_source && sc->ictl.clock_source)
 		sc->timing = LMC_CTL_CLOCK_SOURCE_EXT;
-		lmc_hssi_set_clock(sc, LMC_CTL_CLOCK_SOURCE_EXT);
-	}
-
-	lmc_set_protocol(sc, ctl);
+	lmc_hssi_set_clock(sc, sc->timing);
 }
 
 /* Return hardware link status. 0 == link is down, 1 == link is up. */
@@ -470,7 +454,6 @@ static void lmc_ds3_set_status(struct card * const sc, struct control *ctl)
 	if (ctl == NULL) {
 		lmc_ds3_set_100ft(sc, sc->ictl.cable_length);
 		lmc_ds3_set_scram(sc, sc->ictl.scrambler_onoff);
-		lmc_set_protocol(sc, NULL);
 		return;
 	}
 
@@ -485,8 +468,6 @@ static void lmc_ds3_set_status(struct card * const sc, struct control *ctl)
 		lmc_ds3_set_scram(sc, LMC_CTL_ON);
 	else if (!ctl->scrambler_onoff && sc->ictl.scrambler_onoff)
 		lmc_ds3_set_scram(sc, LMC_CTL_OFF);
-
-	lmc_set_protocol(sc, ctl);
 }
 
 static void lmc_ds3_init(struct card * const sc)
@@ -732,7 +713,6 @@ static void lmc_t1_set_status(struct card * const sc, struct control *ctl)
 {
 	if (ctl == NULL) {
 		lmc_t1_set_circuit_type(sc, sc->ictl.circuit_type);
-		lmc_set_protocol(sc, NULL);
 		return;
 	}
 	/* check for change in circuit type */
@@ -742,7 +722,6 @@ static void lmc_t1_set_status(struct card * const sc, struct control *ctl)
 	else if (ctl->circuit_type == LMC_CTL_CIRCUIT_TYPE_E1
 		 && sc->ictl.circuit_type == LMC_CTL_CIRCUIT_TYPE_T1)
 		lmc_t1_set_circuit_type(sc, LMC_CTL_CIRCUIT_TYPE_T1);
-	lmc_set_protocol(sc, ctl);
 }
 
 /* Return hardware link status. 0 == link is down, 1 == link is up. */
diff --git a/drivers/net/wan/lmc/var.h b/drivers/net/wan/lmc/var.h
index 971f5d6..93c21fe 100644
--- a/drivers/net/wan/lmc/var.h
+++ b/drivers/net/wan/lmc/var.h
@@ -152,7 +152,7 @@ struct control {
 	u32 cable_length;		/* DS3 */
 	u32 scrambler_onoff;		/* DS3 */
 	u32 cable_type;			/* T1 */
-	u32 keepalive_onoff;		/* protocol */
+	u32 keepalive_onoff;		/* unused */
 	u32 ticks;			/* ticks/sec */
 	union {
 		lmc_av9110_t ssi;
-- 
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