rtl8139, ipro1000: Don't shadow "ticks" global variable.

The next commit will make it a "#define" instead of an "extern".
I've already submitted this for upstream inclusion in FreeBSD.

Sorry for the noisy diff with all the whitespace changes...
This commit is contained in:
Augustin Cavalier
2018-10-31 19:03:39 -04:00
parent 18033c30dc
commit 04b07407ef
3 changed files with 171 additions and 171 deletions
@@ -6053,7 +6053,7 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
struct em_int_delay_info *info;
struct adapter *adapter;
u32 regval;
int error, usecs, ticks;
int error, usecs, _ticks;
info = (struct em_int_delay_info *)arg1;
usecs = info->value;
@@ -6063,21 +6063,21 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
if (usecs < 0 || usecs > EM_TICKS_TO_USECS(65535))
return (EINVAL);
info->value = usecs;
ticks = EM_USECS_TO_TICKS(usecs);
_ticks = EM_USECS_TO_TICKS(usecs);
if (info->offset == E1000_ITR) /* units are 256ns here */
ticks *= 4;
_ticks *= 4;
adapter = info->adapter;
EM_CORE_LOCK(adapter);
regval = E1000_READ_OFFSET(&adapter->hw, info->offset);
regval = (regval & ~0xffff) | (ticks & 0xffff);
regval = (regval & ~0xffff) | (_ticks & 0xffff);
/* Handle a few special cases. */
switch (info->offset) {
case E1000_RDTR:
break;
case E1000_TIDV:
if (ticks == 0) {
if (_ticks == 0) {
adapter->txd_cmd &= ~E1000_TXD_CMD_IDE;
/* Don't write 0 into the TIDV register. */
regval++;
@@ -4872,7 +4872,7 @@ lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
u32 regval;
int error;
int usecs;
int ticks;
int _ticks;
info = (struct em_int_delay_info *)arg1;
usecs = info->value;
@@ -4882,21 +4882,21 @@ lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS)
if (usecs < 0 || usecs > EM_TICKS_TO_USECS(65535))
return (EINVAL);
info->value = usecs;
ticks = EM_USECS_TO_TICKS(usecs);
_ticks = EM_USECS_TO_TICKS(usecs);
if (info->offset == E1000_ITR) /* units are 256ns here */
ticks *= 4;
_ticks *= 4;
adapter = info->adapter;
EM_CORE_LOCK(adapter);
regval = E1000_READ_OFFSET(&adapter->hw, info->offset);
regval = (regval & ~0xffff) | (ticks & 0xffff);
regval = (regval & ~0xffff) | (_ticks & 0xffff);
/* Handle a few special cases. */
switch (info->offset) {
case E1000_RDTR:
break;
case E1000_TIDV:
if (ticks == 0) {
if (_ticks == 0) {
adapter->txd_cmd &= ~E1000_TXD_CMD_IDE;
/* Don't write 0 into the TIDV register. */
regval++;
@@ -1397,7 +1397,7 @@ rl_tick(void *xsc)
{
struct rl_softc *sc = xsc;
struct mii_data *mii;
int ticks;
int _ticks;
RL_LOCK_ASSERT(sc);
/*
@@ -1421,15 +1421,15 @@ rl_tick(void *xsc)
else
rl_twister_update(sc);
if (sc->rl_twister == DONE)
ticks = hz;
_ticks = hz;
else
ticks = hz / 10;
_ticks = hz / 10;
} else {
rl_watchdog(sc);
ticks = hz;
_ticks = hz;
}
callout_reset(&sc->rl_stat_callout, ticks, rl_tick, sc);
callout_reset(&sc->rl_stat_callout, _ticks, rl_tick, sc);
}
#ifdef DEVICE_POLLING