dev/usb: unsigned some loop indexes.

Although usually small, values produced by nitems() are unsigned.
By unsigning the corresponding indexes we avoid signed vs unsigned
comparisons. This may have some effect on performance, although given the
small sizes the effect will not be perceivable, and it makes the code
clearer.

Respect the style of the changed files: one uses u_int while the other
uses "unsigned int".

Reviewed by:	hselasky
This commit is contained in:
Pedro F. Giffuni 2016-05-06 15:09:21 +00:00
parent b0b3f0e152
commit 25cd047538
2 changed files with 9 additions and 9 deletions

View File

@ -5222,7 +5222,7 @@ run_rssi2dbm(struct run_softc *sc, uint8_t rssi, uint8_t rxchain)
static void
run_rt5390_bbp_init(struct run_softc *sc)
{
int i;
u_int i;
uint8_t bbp;
/* Apply maximum likelihood detection for 2 stream case. */
@ -5332,7 +5332,7 @@ run_rt3070_rf_init(struct run_softc *sc)
{
uint32_t tmp;
uint8_t bbp4, mingain, rf, target;
int i;
u_int i;
run_rt3070_rf_read(sc, 30, &rf);
/* toggle RF R30 bit 7 */
@ -5476,7 +5476,7 @@ run_rt3593_rf_init(struct run_softc *sc)
{
uint32_t tmp;
uint8_t rf;
int i;
u_int i;
/* Disable the GPIO bits 4 and 7 for LNA PE control. */
run_read(sc, RT3070_GPIO_SWITCH, &tmp);
@ -5525,7 +5525,7 @@ run_rt5390_rf_init(struct run_softc *sc)
{
uint32_t tmp;
uint8_t rf;
int i;
u_int i;
/* Toggle RF R2 to initiate calibration. */
if (sc->mac_ver == 0x5390) {

View File

@ -1910,7 +1910,7 @@ fail:
static uint16_t
urtw_rate2rtl(uint32_t rate)
{
int i;
unsigned int i;
for (i = 0; i < nitems(urtw_ratetable); i++) {
if (rate == urtw_ratetable[i].reg)
@ -1923,7 +1923,7 @@ urtw_rate2rtl(uint32_t rate)
static uint16_t
urtw_rtl2rate(uint32_t rate)
{
int i;
unsigned int i;
for (i = 0; i < nitems(urtw_ratetable); i++) {
if (rate == urtw_ratetable[i].val)
@ -2450,7 +2450,7 @@ fail:
static usb_error_t
urtw_8225_rf_init(struct urtw_softc *sc)
{
int i;
unsigned int i;
uint16_t data;
usb_error_t error;
@ -2831,7 +2831,7 @@ fail:
static usb_error_t
urtw_8225v2_rf_init(struct urtw_softc *sc)
{
int i;
unsigned int i;
uint16_t data;
uint32_t data32;
usb_error_t error;
@ -3164,7 +3164,7 @@ static usb_error_t
urtw_8225v2b_rf_init(struct urtw_softc *sc)
{
struct ieee80211com *ic = &sc->sc_ic;
int i;
unsigned int i;
uint8_t data8;
usb_error_t error;