if (!extra)
return -EINVAL;
- iw->spy_num = min(ARRAY_SIZE(iw->spy_addr), dwrq->length);
+ iw->spy_num = min_t(int, ARRAY_SIZE(iw->spy_addr), dwrq->length);
for (i = 0; i < iw->spy_num; i++)
memcpy(&iw->spy_addr[i], addr[i].sa_data, ETHER_ADDR_LEN);
memset(iw->spy_qual, 0, sizeof(iw->spy_qual));
__func__, req->essid));
return -EBUSY;
} else {
- g_specific_ssid.SSID_len =
- min(sizeof(g_specific_ssid.SSID),
- req->essid_len);
+ g_specific_ssid.SSID_len = min_t(unsigned char,
+ sizeof(g_specific_ssid.SSID),
+ req->essid_len);
memcpy(g_specific_ssid.SSID, req->essid,
g_specific_ssid.SSID_len);
g_specific_ssid.SSID_len =
if (wrqu->data.length == sizeof(struct iw_scan_req)) {
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)extra;
- ssid.SSID_len = min(sizeof(ssid.SSID), req->essid_len);
+ ssid.SSID_len = min_t(unsigned char, sizeof(ssid.SSID),
+ req->essid_len);
memcpy(ssid.SSID, req->essid, ssid.SSID_len);
ssid.SSID_len = htod32(ssid.SSID_len);
} else {
if (dwrq->length && extra) {
#if WIRELESS_EXT > 20
- g_ssid.SSID_len = min(sizeof(g_ssid.SSID), dwrq->length);
+ g_ssid.SSID_len = min_t(unsigned char, sizeof(g_ssid.SSID),
+ dwrq->length);
#else
- g_ssid.SSID_len = min(sizeof(g_ssid.SSID), dwrq->length - 1);
+ g_ssid.SSID_len = min_t(unsigned char, sizeof(g_ssid.SSID),
+ dwrq->length - 1);
#endif
memcpy(g_ssid.SSID, extra, g_ssid.SSID_len);
} else {
wsec = dtoh32(wsec);
auth = dtoh32(auth);
- dwrq->length = min(DOT11_MAX_KEY_SIZE, key.len);
+ dwrq->length = min_t(u16, DOT11_MAX_KEY_SIZE, key.len);
dwrq->flags = key.index + 1;
if (!(wsec & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED)))