diff mbox series

rtl8xxxu: Fix sparse warning: cast from restricted __le16

Message ID 20200319064341.49500-1-chiu@endlessm.com (mailing list archive)
State Accepted
Commit 8d4ccd7770e795e03c217624507ce17b5ab1c156
Delegated to: Kalle Valo
Headers show
Series rtl8xxxu: Fix sparse warning: cast from restricted __le16 | expand

Commit Message

Chris Chiu March 19, 2020, 6:43 a.m. UTC
Fix the warning reported by sparse as:
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4819:17: sparse: sparse: cast from restricted __le16
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4892:17: sparse: sparse: cast from restricted __le16

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jes Sorensen March 19, 2020, 2:19 p.m. UTC | #1
On 3/19/20 2:43 AM, Chris Chiu wrote:
> Fix the warning reported by sparse as:
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4819:17: sparse: sparse: cast from restricted __le16
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4892:17: sparse: sparse: cast from restricted __le16
> 
> Signed-off-by: Chris Chiu <chiu@endlessm.com>
> Reported-by: kbuild test robot <lkp@intel.com>

Acked-by: Jes Sorensen <jes@trained-monkey.org>


> ---
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 54a1a4ea107b..daa6ce14c68b 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -4816,8 +4816,8 @@ rtl8xxxu_fill_txdesc_v1(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
>  		rate = tx_rate->hw_value;
>  
>  	if (rtl8xxxu_debug & RTL8XXXU_DEBUG_TX)
> -		dev_info(dev, "%s: TX rate: %d, pkt size %d\n",
> -			 __func__, rate, cpu_to_le16(tx_desc->pkt_size));
> +		dev_info(dev, "%s: TX rate: %d, pkt size %u\n",
> +			 __func__, rate, le16_to_cpu(tx_desc->pkt_size));
>  
>  	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
>  
> @@ -4889,8 +4889,8 @@ rtl8xxxu_fill_txdesc_v2(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
>  		rate = tx_rate->hw_value;
>  
>  	if (rtl8xxxu_debug & RTL8XXXU_DEBUG_TX)
> -		dev_info(dev, "%s: TX rate: %d, pkt size %d\n",
> -			 __func__, rate, cpu_to_le16(tx_desc40->pkt_size));
> +		dev_info(dev, "%s: TX rate: %d, pkt size %u\n",
> +			 __func__, rate, le16_to_cpu(tx_desc40->pkt_size));
>  
>  	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
>  
>
Kalle Valo March 23, 2020, 5:36 p.m. UTC | #2
Chris Chiu <chiu@endlessm.com> wrote:

> Fix the warning reported by sparse as:
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4819:17: sparse: sparse: cast from restricted __le16
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:4892:17: sparse: sparse: cast from restricted __le16
> 
> Signed-off-by: Chris Chiu <chiu@endlessm.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> Acked-by: Jes Sorensen <jes@trained-monkey.org>

Patch applied to wireless-drivers-next.git, thanks.

8d4ccd7770e7 rtl8xxxu: Fix sparse warning: cast from restricted __le16
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 54a1a4ea107b..daa6ce14c68b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -4816,8 +4816,8 @@  rtl8xxxu_fill_txdesc_v1(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
 		rate = tx_rate->hw_value;
 
 	if (rtl8xxxu_debug & RTL8XXXU_DEBUG_TX)
-		dev_info(dev, "%s: TX rate: %d, pkt size %d\n",
-			 __func__, rate, cpu_to_le16(tx_desc->pkt_size));
+		dev_info(dev, "%s: TX rate: %d, pkt size %u\n",
+			 __func__, rate, le16_to_cpu(tx_desc->pkt_size));
 
 	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
 
@@ -4889,8 +4889,8 @@  rtl8xxxu_fill_txdesc_v2(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
 		rate = tx_rate->hw_value;
 
 	if (rtl8xxxu_debug & RTL8XXXU_DEBUG_TX)
-		dev_info(dev, "%s: TX rate: %d, pkt size %d\n",
-			 __func__, rate, cpu_to_le16(tx_desc40->pkt_size));
+		dev_info(dev, "%s: TX rate: %d, pkt size %u\n",
+			 __func__, rate, le16_to_cpu(tx_desc40->pkt_size));
 
 	seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));