Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3173c890 authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Jeff Garzik
Browse files

[PATCH] drivers/net: fix-up schedule_timeout() usage



Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 343c686c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1029,8 +1029,7 @@ static void cp_reset_hw (struct cp_private *cp)
		if (!(cpr8(Cmd) & CmdReset))
			return;

		set_current_state(TASK_UNINTERRUPTIBLE);
		schedule_timeout(10);
		schedule_timeout_uninterruptible(10);
	}

	printk(KERN_ERR "%s: hardware reset timeout\n", cp->dev->name);
+16 −32
Original line number Diff line number Diff line
@@ -2517,10 +2517,8 @@ static int hp100_down_vg_link(struct net_device *dev)
	do {
		if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST)
			break;
		if (!in_interrupt()) {
			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(1);
		}
		if (!in_interrupt())
			schedule_timeout_interruptible(1);
	} while (time_after(time, jiffies));

	if (time_after_eq(jiffies, time))	/* no signal->no logout */
@@ -2536,10 +2534,8 @@ static int hp100_down_vg_link(struct net_device *dev)
	do {
		if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
			break;
		if (!in_interrupt()) {
			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(1);
		}
		if (!in_interrupt())
			schedule_timeout_interruptible(1);
	} while (time_after(time, jiffies));

#ifdef HP100_DEBUG
@@ -2577,10 +2573,8 @@ static int hp100_down_vg_link(struct net_device *dev)
		do {
			if (!(hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST))
				break;
			if (!in_interrupt()) {
				set_current_state(TASK_INTERRUPTIBLE);
				schedule_timeout(1);
			}
			if (!in_interrupt())
				schedule_timeout_interruptible(1);
		} while (time_after(time, jiffies));

		hp100_orb(HP100_AUTO_MODE, MAC_CFG_3);	/* Autosel back on */
@@ -2591,10 +2585,8 @@ static int hp100_down_vg_link(struct net_device *dev)
	do {
		if ((hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) == 0)
			break;
		if (!in_interrupt()) {
			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(1);
		}
		if (!in_interrupt())
			schedule_timeout_interruptible(1);
	} while (time_after(time, jiffies));

	if (time_before_eq(time, jiffies)) {
@@ -2606,10 +2598,8 @@ static int hp100_down_vg_link(struct net_device *dev)

	time = jiffies + (2 * HZ);	/* This seems to take a while.... */
	do {
		if (!in_interrupt()) {
			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(1);
		}
		if (!in_interrupt())
			schedule_timeout_interruptible(1);
	} while (time_after(time, jiffies));

	return 0;
@@ -2659,10 +2649,8 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
		do {
			if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
				break;
			if (!in_interrupt()) {
				set_current_state(TASK_INTERRUPTIBLE);
				schedule_timeout(1);
			}
			if (!in_interrupt())
				schedule_timeout_interruptible(1);
		} while (time_after(time, jiffies));

		/* Start an addressed training and optionally request promiscuous port */
@@ -2697,10 +2685,8 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
		do {
			if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST)
				break;
			if (!in_interrupt()) {
				set_current_state(TASK_INTERRUPTIBLE);
				schedule_timeout(1);
			}
			if (!in_interrupt())
				schedule_timeout_interruptible(1);
		} while (time_before(jiffies, time));

		if (time_after_eq(jiffies, time)) {
@@ -2723,10 +2709,8 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin)
#endif
					break;
				}
				if (!in_interrupt()) {
					set_current_state(TASK_INTERRUPTIBLE);
					schedule_timeout(1);
				}
				if (!in_interrupt())
					schedule_timeout_interruptible(1);
			} while (time_after(time, jiffies));
		}

+3 −4
Original line number Diff line number Diff line
@@ -678,10 +678,9 @@ static void turnaround_delay(const struct stir_cb *stir, long us)
		return;

	ticks = us / (1000000 / HZ);
	if (ticks > 0) {
		current->state = TASK_INTERRUPTIBLE;
		schedule_timeout(1 + ticks);
	} else
	if (ticks > 0)
		schedule_timeout_interruptible(1 + ticks);
	else
		udelay(us);
}

+3 −4
Original line number Diff line number Diff line
@@ -645,11 +645,10 @@ ixgb_phys_id(struct net_device *netdev, uint32_t data)

	mod_timer(&adapter->blink_timer, jiffies);

	set_current_state(TASK_INTERRUPTIBLE);
	if (data)
		schedule_timeout(data * HZ);
		schedule_timeout_interruptible(data * HZ);
	else
		schedule_timeout(MAX_SCHEDULE_TIMEOUT);
		schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT);

	del_timer_sync(&adapter->blink_timer);
	ixgb_led_off(&adapter->hw);
+1 −2
Original line number Diff line number Diff line
@@ -1632,8 +1632,7 @@ static void ns83820_run_bist(struct net_device *ndev, const char *name, u32 enab
			timed_out = 1;
			break;
		}
		set_current_state(TASK_UNINTERRUPTIBLE);
		schedule_timeout(1);
		schedule_timeout_uninterruptible(1);
	}

	if (status & fail)
Loading