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

Commit 2c208890 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

wireless: Remove casts to same type



Adding casts of objects to the same type is unnecessary
and confusing for a human reader.

For example, this cast:

        int y;
        int *p = (int *)&y;

I used the coccinelle script below to find and remove these
unnecessary casts.  I manually removed the conversions this
script produces of casts with __force, __iomem and __user.

@@
type T;
T *p;
@@

-       (T *)p
+       p

Neatened the mwifiex_deauthenticate_infra function which
was doing odd things with array pointers and not using
is_zero_ether_addr.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64699336
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1738,8 +1738,7 @@ static int adm8211_alloc_rings(struct ieee80211_hw *dev)
		return -ENOMEM;
	}

	priv->tx_ring = (struct adm8211_desc *)(priv->rx_ring +
						priv->rx_ring_size);
	priv->tx_ring = priv->rx_ring + priv->rx_ring_size;
	priv->tx_ring_dma = priv->rx_ring_dma +
			    sizeof(struct adm8211_desc) * priv->rx_ring_size;

+2 −2
Original line number Diff line number Diff line
@@ -1997,7 +1997,7 @@ static int mpi_send_packet (struct net_device *dev)
 *                         ------------------------------------------------
 */

	memcpy((char *)ai->txfids[0].virtual_host_addr,
	memcpy(ai->txfids[0].virtual_host_addr,
		(char *)&wifictlhdr8023, sizeof(wifictlhdr8023));

	payloadLen = (__le16 *)(ai->txfids[0].virtual_host_addr +
@@ -4212,7 +4212,7 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid,
			airo_print_err(ai->dev->name, "%s: len=%d", __func__, len);
			rc = -1;
		} else {
			memcpy((char *)ai->config_desc.virtual_host_addr,
			memcpy(ai->config_desc.virtual_host_addr,
				pBuf, len);

			rc = issuecommand(ai, &cmd, &rsp);
+2 −2
Original line number Diff line number Diff line
@@ -3178,7 +3178,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
				mdata_size, length);
			return -1;
		}
		memcpy(mptr, (u8 *) (word + COMP_HDR_LEN), length);
		memcpy(mptr, word + COMP_HDR_LEN, length);
		ath_dbg(common, EEPROM,
			"restored eeprom %d: uncompressed, length %d\n",
			it, length);
@@ -3199,7 +3199,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
			"restore eeprom %d: block, reference %d, length %d\n",
			it, reference, length);
		ar9300_uncompress_block(ah, mptr, mdata_size,
					(u8 *) (word + COMP_HDR_LEN), length);
					(word + COMP_HDR_LEN), length);
		break;
	default:
		ath_dbg(common, EEPROM, "unknown compression code %d\n", code);
+1 −2
Original line number Diff line number Diff line
@@ -188,8 +188,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
{
#define EEPROM_4K_SIZE (sizeof(struct ar5416_eeprom_4k) / sizeof(u16))
	struct ath_common *common = ath9k_hw_common(ah);
	struct ar5416_eeprom_4k *eep =
		(struct ar5416_eeprom_4k *) &ah->eeprom.map4k;
	struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
	u16 *eepdata, temp, magic, magic2;
	u32 sum = 0, el;
	bool need_swap = false;
+1 −2
Original line number Diff line number Diff line
@@ -264,8 +264,7 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,

static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
{
	struct ar5416_eeprom_def *eep =
		(struct ar5416_eeprom_def *) &ah->eeprom.def;
	struct ar5416_eeprom_def *eep = &ah->eeprom.def;
	struct ath_common *common = ath9k_hw_common(ah);
	u16 *eepdata, temp, magic, magic2;
	u32 sum = 0, el;
Loading