Staging: brcm80211: brcmfmac: fix some comparison warnings
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Oct 2010 19:37:39 +0000 (12:37 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Oct 2010 19:37:39 +0000 (12:37 -0700)
Use min_t() instead of min() in some places to make the
comparison explicit and resolve some compiler warnings.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c

index 5621680bbe814e7f49c8cc672baad55660d75689..ed450e554b9c6013b16d6b5f6738164e5278f9ec 100644 (file)
@@ -979,7 +979,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, void *pkt, uint chan, bool free_pkt)
              (DHD_DATA_ON() && (chan != SDPCM_CONTROL_CHANNEL))))) {
                prhex("Tx Frame", frame, len);
        } else if (DHD_HDRS_ON()) {
-               prhex("TxHdr", frame, min(len, 16));
+               prhex("TxHdr", frame, min_t(u16, len, 16));
        }
 #endif
 
@@ -1312,7 +1312,7 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
                if (DHD_BYTES_ON() && DHD_CTL_ON())
                        prhex("Tx Frame", frame, len);
                else if (DHD_HDRS_ON())
-                       prhex("TxHdr", frame, min(len, 16));
+                       prhex("TxHdr", frame, min_t(u16, len, 16));
 #endif
 
                do {
@@ -1737,7 +1737,7 @@ dhdsdio_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
                                break;
                        }
                        sdaddr = 0;
-                       dsize = min(SBSDIO_SB_OFT_ADDR_LIMIT, size);
+                       dsize = min_t(uint, SBSDIO_SB_OFT_ADDR_LIMIT, size);
                }
        }
 
@@ -3355,7 +3355,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
 #ifdef DHD_DEBUG
                if (DHD_GLOM_ON()) {
                        prhex("SUPERFRAME", PKTDATA(pfirst),
-                             min(PKTLEN(pfirst), 48));
+                             min_t(int, PKTLEN(pfirst), 48));
                }
 #endif
 
@@ -3559,7 +3559,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
                                PKTLEN(pfirst), PKTNEXT(pfirst),
                                PKTLINK(pfirst)));
                                prhex("", (u8 *) PKTDATA(pfirst),
-                                     min(PKTLEN(pfirst), 32));
+                                     min_t(int, PKTLEN(pfirst), 32));
                        }
 #endif                         /* DHD_DEBUG */
                }
index 2dae1a93f6b100d3fb73305eee926537f7dcac38..9006d317b996d3bd3c0691999f8833c7e1ddcee2 100644 (file)
@@ -804,7 +804,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
                        ssids->ssid, ssids->ssid_len));
                memset(&sr->ssid, 0, sizeof(sr->ssid));
                sr->ssid.SSID_len =
-                           min(sizeof(sr->ssid.SSID), ssids->ssid_len);
+                           min_t(u8, sizeof(sr->ssid.SSID), ssids->ssid_len);
                if (sr->ssid.SSID_len) {
                        memcpy(sr->ssid.SSID, ssids->ssid, sr->ssid.SSID_len);
                        sr->ssid.SSID_len = htod32(sr->ssid.SSID_len);
@@ -1754,7 +1754,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
        key.index = key_idx;
        swap_key_to_BE(&key);
        memset(&params, 0, sizeof(params));
-       params.key_len = (u8) min(DOT11_MAX_KEY_SIZE, key.len);
+       params.key_len = (u8) min_t(u8, DOT11_MAX_KEY_SIZE, key.len);
        memcpy(params.key, key.data, params.key_len);
 
        err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));