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

Commit c8e49556 authored by Silvan Jegen's avatar Silvan Jegen Committed by John W. Linville
Browse files

net: Replace min macro with min_t



Instead of an explicit cast, use the min_t macro.

Signed-off-by: default avatarSilvan Jegen <s.jegen@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9ffd2e9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1549,7 +1549,7 @@ static void b43_write_beacon_template(struct b43_wldev *dev,
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(dev->wl->current_beacon);
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(dev->wl->current_beacon);


	bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data);
	bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data);
	len = min((size_t) dev->wl->current_beacon->len,
	len = min_t(size_t, dev->wl->current_beacon->len,
		  0x200 - sizeof(struct b43_plcp_hdr6));
		  0x200 - sizeof(struct b43_plcp_hdr6));
	rate = ieee80211_get_tx_rate(dev->wl->hw, info)->hw_value;
	rate = ieee80211_get_tx_rate(dev->wl->hw, info)->hw_value;


+1 −1
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@ static int get_integer(const char *buf, size_t count)


	if (count == 0)
	if (count == 0)
		goto out;
		goto out;
	count = min(count, (size_t) 10);
	count = min_t(size_t, count, 10);
	memcpy(tmp, buf, count);
	memcpy(tmp, buf, count);
	ret = simple_strtol(tmp, NULL, 10);
	ret = simple_strtol(tmp, NULL, 10);
      out:
      out:
+1 −1
Original line number Original line Diff line number Diff line
@@ -337,7 +337,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
			/* iv16 */
			/* iv16 */
			memcpy(txhdr->iv + 10, ((u8 *) wlhdr) + wlhdr_len, 3);
			memcpy(txhdr->iv + 10, ((u8 *) wlhdr) + wlhdr_len, 3);
		} else {
		} else {
			iv_len = min((size_t) info->control.hw_key->iv_len,
			iv_len = min_t(size_t, info->control.hw_key->iv_len,
				     ARRAY_SIZE(txhdr->iv));
				     ARRAY_SIZE(txhdr->iv));
			memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
			memcpy(txhdr->iv, ((u8 *) wlhdr) + wlhdr_len, iv_len);
		}
		}
+2 −2
Original line number Original line Diff line number Diff line
@@ -978,7 +978,7 @@ static void b43legacy_write_beacon_template(struct b43legacy_wldev *dev,
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(dev->wl->current_beacon);
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(dev->wl->current_beacon);


	bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data);
	bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data);
	len = min((size_t)dev->wl->current_beacon->len,
	len = min_t(size_t, dev->wl->current_beacon->len,
		  0x200 - sizeof(struct b43legacy_plcp_hdr6));
		  0x200 - sizeof(struct b43legacy_plcp_hdr6));
	rate = ieee80211_get_tx_rate(dev->wl->hw, info)->hw_value;
	rate = ieee80211_get_tx_rate(dev->wl->hw, info)->hw_value;


@@ -1155,7 +1155,7 @@ static void b43legacy_write_probe_resp_template(struct b43legacy_wldev *dev,
	b43legacy_write_probe_resp_plcp(dev, 0x350, size,
	b43legacy_write_probe_resp_plcp(dev, 0x350, size,
					&b43legacy_b_ratetable[3]);
					&b43legacy_b_ratetable[3]);


	size = min((size_t)size,
	size = min_t(size_t, size,
		   0x200 - sizeof(struct b43legacy_plcp_hdr6));
		   0x200 - sizeof(struct b43legacy_plcp_hdr6));
	b43legacy_write_template_common(dev, probe_resp_data,
	b43legacy_write_template_common(dev, probe_resp_data,
					size, ram_offset,
					size, ram_offset,
+1 −1
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@ static int get_integer(const char *buf, size_t count)


	if (count == 0)
	if (count == 0)
		goto out;
		goto out;
	count = min(count, (size_t)10);
	count = min_t(size_t, count, 10);
	memcpy(tmp, buf, count);
	memcpy(tmp, buf, count);
	ret = simple_strtol(tmp, NULL, 10);
	ret = simple_strtol(tmp, NULL, 10);
out:
out:
Loading