From c8002e5c4b415cf48a520b34852ae92e2f20bfd5 Mon Sep 17 00:00:00 2001 From: Gunjan Gupta Date: Sun, 3 Sep 2023 11:02:51 +0000 Subject: [PATCH 1/2] Cleanup for some compilation warnings --- drivers/net/wireless/xradio/bh.c | 12 ++++++------ drivers/net/wireless/xradio/fwio.c | 4 ++-- drivers/net/wireless/xradio/keys.c | 4 +++- drivers/net/wireless/xradio/scan.c | 2 +- drivers/net/wireless/xradio/tx.c | 4 ++-- drivers/net/wireless/xradio/wsm.c | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/xradio/bh.c b/drivers/net/wireless/xradio/bh.c index c8a7b8615e5d..4cc50a98d5c2 100644 --- a/drivers/net/wireless/xradio/bh.c +++ b/drivers/net/wireless/xradio/bh.c @@ -323,11 +323,11 @@ static struct sk_buff *xradio_get_skb(struct xradio_common *hw_priv, size_t len) } else { skb = xradio_get_resv_skb(hw_priv, alloc_len); if (skb) { - xr_printk(XRADIO_DBG_WARN, "BH: no skb avail., using reserve skb (%d)!\n", alloc_len); + xr_printk(XRADIO_DBG_WARN, "BH: no skb avail., using reserve skb (%zu)!\n", alloc_len); skb_reserve(skb, WSM_TX_EXTRA_HEADROOM + 8 /* TKIP IV */ - WSM_RX_EXTRA_HEADROOM); } else { - xr_printk(XRADIO_DBG_WARN, "BH - get_skb: no skb avail, no reserve (%d)!\n", alloc_len); + xr_printk(XRADIO_DBG_WARN, "BH - get_skb: no skb avail, no reserve (%zu)!\n", alloc_len); } } } else { @@ -467,7 +467,7 @@ static int xradio_bh_rx(struct xradio_common *hw_priv, u16* nextlen) { return read_len; if (read_len < sizeof(struct wsm_hdr) || (read_len > EFFECTIVE_BUF_SIZE)) { - xr_printk(XRADIO_DBG_ERROR, "BH: Invalid read len: %d", read_len); + xr_printk(XRADIO_DBG_ERROR, "BH: Invalid read len: %zu", read_len); return -1; } @@ -478,7 +478,7 @@ static int xradio_bh_rx(struct xradio_common *hw_priv, u16* nextlen) { alloc_len = sdio_align_len(hw_priv, read_len); /* Check if not exceeding XRADIO capabilities */ if (WARN_ON_ONCE(alloc_len > EFFECTIVE_BUF_SIZE)) { - xr_printk(XRADIO_DBG_ERROR, "BH: Read aligned len: %d\n", alloc_len); + xr_printk(XRADIO_DBG_ERROR, "BH: Read aligned len: %zu\n", alloc_len); } /* Get skb buffer. */ @@ -514,7 +514,7 @@ static int xradio_bh_rx(struct xradio_common *hw_priv, u16* nextlen) { wsm_len = __le32_to_cpu(wsm->len); if (WARN_ON(wsm_len > read_len)) { - xr_printk(XRADIO_DBG_ERROR, "BH: wsm is bigger than data read, read %d but frame is %d\n", + xr_printk(XRADIO_DBG_ERROR, "BH: wsm is bigger than data read, read %zu but frame is %zu\n", read_len, wsm_len); ret = -1; goto out; @@ -682,7 +682,7 @@ static int xradio_bh_tx(struct xradio_common *hw_priv){ /* Check if not exceeding XRADIO capabilities */ if (tx_len > EFFECTIVE_BUF_SIZE) { - xr_printk(XRADIO_DBG_WARN, "BH: Write aligned len: %d\n", tx_len); + xr_printk(XRADIO_DBG_WARN, "BH: Write aligned len: %zu\n", tx_len); } /* Make sequence number. */ diff --git a/drivers/net/wireless/xradio/fwio.c b/drivers/net/wireless/xradio/fwio.c index 29916ab26681..4b9d92a1bebd 100644 --- a/drivers/net/wireless/xradio/fwio.c +++ b/drivers/net/wireless/xradio/fwio.c @@ -62,7 +62,7 @@ static int xradio_get_hw_type(u32 config_reg_val, int *major_revision) //u32 hif_vers = (config_reg_val >> 31) & 0x1; /* Check if we have XRADIO*/ - if (hif_type == 0x4) { + if (hif_type == 0x4) { *major_revision = 0x4; hw_type = HIF_HW_TYPE_XRADIO; } else { @@ -164,7 +164,7 @@ static int xradio_parse_sdd(struct xradio_common *hw_priv, u32 *dpll) pElement = FIND_NEXT_ELT(pElement); } - xr_printk(XRADIO_DBG_NIY, "FWIO: sdd size=%d parse len=%d.\n", + xr_printk(XRADIO_DBG_NIY, "FWIO: sdd size=%zu parse len=%d.\n", hw_priv->sdd->size, parsedLength); // diff --git a/drivers/net/wireless/xradio/keys.c b/drivers/net/wireless/xradio/keys.c index efa7044870f8..7e5cd6e1520c 100644 --- a/drivers/net/wireless/xradio/keys.c +++ b/drivers/net/wireless/xradio/keys.c @@ -62,7 +62,7 @@ int xradio_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, u8 *peer_addr = NULL; int pairwise = (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) ? 1 : 0; int idx = xradio_alloc_key(hw_priv); - struct wsm_add_key *wsm_key = &hw_priv->keys[idx]; + struct wsm_add_key *wsm_key; if (idx < 0) { sta_printk(XRADIO_DBG_ERROR, "xradio_alloc_key failed!\n"); @@ -70,6 +70,8 @@ int xradio_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, goto finally; } + wsm_key = &hw_priv->keys[idx]; + BUG_ON(pairwise && !sta); if (sta) peer_addr = sta->addr; diff --git a/drivers/net/wireless/xradio/scan.c b/drivers/net/wireless/xradio/scan.c index ec34def497c1..d9101bfce9e9 100644 --- a/drivers/net/wireless/xradio/scan.c +++ b/drivers/net/wireless/xradio/scan.c @@ -887,7 +887,7 @@ void xradio_probe_work(struct work_struct *work) if (!ret) IEEE80211_SKB_CB(frame.skb)->flags |= IEEE80211_TX_STAT_ACK; - BUG_ON(xradio_queue_remove(queue, hw_priv->pending_frame_id)); + BUG_ON(xradio_queue_remove(queue, hw_priv->pending_frame_id)); if (ret) { hw_priv->scan.direct_probe = 0; diff --git a/drivers/net/wireless/xradio/tx.c b/drivers/net/wireless/xradio/tx.c index af7f3698971e..029d37ebfde7 100644 --- a/drivers/net/wireless/xradio/tx.c +++ b/drivers/net/wireless/xradio/tx.c @@ -690,7 +690,7 @@ xradio_tx_h_crypt(struct xradio_vif *priv, dev_dbg(priv->hw_priv->pdev, "no space allocated for crypto headers.\n" "headroom: %d, tailroom: %d, " - "req_headroom: %d, req_tailroom: %d\n" + "req_headroom: %zu, req_tailroom: %zu\n" "Please fix it in xradio_get_skb().\n", skb_headroom(t->skb), skb_tailroom(t->skb), iv_len + WSM_TX_EXTRA_HEADROOM, icv_len); @@ -700,7 +700,7 @@ xradio_tx_h_crypt(struct xradio_vif *priv, u8 *p; dev_dbg(priv->hw_priv->pdev, "Slowpath: tailroom is not big enough. " - "Req: %d, got: %d.\n", + "Req: %zu, got: %d.\n", icv_len, skb_tailroom(t->skb)); p = skb_push(t->skb, offset); diff --git a/drivers/net/wireless/xradio/wsm.c b/drivers/net/wireless/xradio/wsm.c index aab827a076e9..14aed3fca36f 100644 --- a/drivers/net/wireless/xradio/wsm.c +++ b/drivers/net/wireless/xradio/wsm.c @@ -1780,7 +1780,7 @@ int wsm_cmd_send(struct xradio_common *hw_priv, hw_priv->wsm_cmd.ptr = NULL; spin_unlock(&hw_priv->wsm_cmd.lock); - wsm_printk(XRADIO_DBG_ERROR,"CMD timeout!>>> 0x%.4X (%d), buf_use=%d, bh_state=%d\n", + wsm_printk(XRADIO_DBG_ERROR,"CMD timeout!>>> 0x%.4X (%zu), buf_use=%d, bh_state=%d\n", cmd, buf_len, hw_priv->hw_bufs_used, hw_priv->bh_error); /* Race condition check to make sure _confirm is not called * after exit of _send */ @@ -2009,7 +2009,7 @@ int wsm_handle_exception(struct xradio_common *hw_priv, u8 *data, size_t len) reason_str[reason]); } else { wsm_printk(XRADIO_DBG_ERROR,"Firmware assert at %.*s, line %d, reason=0x%x\n", - sizeof(fname), fname, reg[1], reg[2]); + (int) sizeof(fname), fname, reg[1], reg[2]); } for (i = 0; i < 12; i += 4) { -- 2.34.1