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

Commit 454127ad authored by Colin Ian King's avatar Colin Ian King Committed by Kalle Valo
Browse files

iwlegacy: remove several redundant variables



Variables id, unicast, write, conf, a_band, accum_tx and ucode are
assigned a value but it is never read, hence they are redundant and
can be removed.

Cleans up clang warnings:
warning: variable 'id' set but not used [-Wunused-but-set-variable]
warning: variable 'unicast' set but not used [-Wunused-but-set-variable]
warning: variable 'write' set but not used [-Wunused-but-set-variable]
warning: variable 'conf' set but not used [-Wunused-but-set-variable]
warning: variable 'a_band' set but not used [-Wunused-but-set-variable]
warning: variable 'tx' set but not used [-Wunused-but-set-variable]
warning: variable 'accum_tx' set but not used [-Wunused-but-set-variable]
warning: variable 'ucode' set but not used [-Wunused-but-set-variable]

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 0e139e97
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -476,8 +476,6 @@ il3945_tx_skb(struct il_priv *il,
	int txq_id = skb_get_queue_mapping(skb);
	u16 len, idx, hdr_len;
	u16 firstlen, secondlen;
	u8 id;
	u8 unicast;
	u8 sta_id;
	u8 tid = 0;
	__le16 fc;
@@ -496,9 +494,6 @@ il3945_tx_skb(struct il_priv *il,
		goto drop_unlock;
	}

	unicast = !is_multicast_ether_addr(hdr->addr1);
	id = 0;

	fc = hdr->frame_control;

#ifdef CONFIG_IWLEGACY_DEBUG
@@ -957,10 +952,8 @@ il3945_rx_queue_restock(struct il_priv *il)
	struct list_head *element;
	struct il_rx_buf *rxb;
	unsigned long flags;
	int write;

	spin_lock_irqsave(&rxq->lock, flags);
	write = rxq->write & ~0x7;
	while (il_rx_queue_space(rxq) > 0 && rxq->free_count) {
		/* Get next free Rx buffer, remove from free list */
		element = rxq->rx_free.next;
@@ -2725,7 +2718,6 @@ void
il3945_post_associate(struct il_priv *il)
{
	int rc = 0;
	struct ieee80211_conf *conf = NULL;

	if (!il->vif || !il->is_open)
		return;
@@ -2738,8 +2730,6 @@ il3945_post_associate(struct il_priv *il)

	il_scan_cancel_timeout(il, 200);

	conf = &il->hw->conf;

	il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
	il3945_commit_rxon(il);

+0 −2
Original line number Diff line number Diff line
@@ -1634,7 +1634,6 @@ il3945_hw_reg_set_txpower(struct il_priv *il, s8 power)
{
	struct il_channel_info *ch_info;
	s8 max_power;
	u8 a_band;
	u8 i;

	if (il->tx_power_user_lmt == power) {
@@ -1650,7 +1649,6 @@ il3945_hw_reg_set_txpower(struct il_priv *il, s8 power)

	for (i = 0; i < il->channel_count; i++) {
		ch_info = &il->channel_info[i];
		a_band = il_is_channel_a_band(ch_info);

		/* find minimum power of all user and regulatory constraints
		 *    (does not consider h/w clipping limitations) */
+0 −6
Original line number Diff line number Diff line
@@ -1338,15 +1338,12 @@ il4965_accumulative_stats(struct il_priv *il, __le32 * stats)
	u32 *accum_stats;
	u32 *delta, *max_delta;
	struct stats_general_common *general, *accum_general;
	struct stats_tx *tx, *accum_tx;

	prev_stats = (__le32 *) &il->_4965.stats;
	accum_stats = (u32 *) &il->_4965.accum_stats;
	size = sizeof(struct il_notif_stats);
	general = &il->_4965.stats.general.common;
	accum_general = &il->_4965.accum_stats.general.common;
	tx = &il->_4965.stats.tx;
	accum_tx = &il->_4965.accum_stats.tx;
	delta = (u32 *) &il->_4965.delta_stats;
	max_delta = (u32 *) &il->_4965.max_delta;

@@ -4784,7 +4781,6 @@ static void
il4965_ucode_callback(const struct firmware *ucode_raw, void *context)
{
	struct il_priv *il = context;
	struct il_ucode_header *ucode;
	int err;
	struct il4965_firmware_pieces pieces;
	const unsigned int api_max = il->cfg->ucode_api_max;
@@ -4814,8 +4810,6 @@ il4965_ucode_callback(const struct firmware *ucode_raw, void *context)
	}

	/* Data from ucode file:  header followed by uCode images */
	ucode = (struct il_ucode_header *)ucode_raw->data;

	err = il4965_load_firmware(il, ucode_raw, &pieces);

	if (err)