diff mbox series

[1/2] rtlwifi: Fix endian issue in ps.c

Message ID 20200604005733.7905-2-Larry.Finger@lwfinger.net (mailing list archive)
State Accepted
Commit 0df9edb37f3c1479e060d4aca73000afe5fe69d4
Delegated to: Kalle Valo
Headers show
Series rtlwifi: Fix some Sparse warnings concerning endianess | expand

Commit Message

Larry Finger June 4, 2020, 12:57 a.m. UTC
Sparse reports the following endian issues:

  CHECK   drivers/net/wireless/realtek/rtlwifi/ps.c
drivers/net/wireless/realtek/rtlwifi/ps.c:772:42: warning: restricted __le32 degrades to integer
drivers/net/wireless/realtek/rtlwifi/ps.c:772:42: warning: cast to restricted __le32
drivers/net/wireless/realtek/rtlwifi/ps.c:775:42: warning: restricted __le32 degrades to integer
drivers/net/wireless/realtek/rtlwifi/ps.c:775:42: warning: cast to restricted __le32
drivers/net/wireless/realtek/rtlwifi/ps.c:778:42: warning: restricted __le32 degrades to integer
drivers/net/wireless/realtek/rtlwifi/ps.c:778:42: warning: cast to restricted __le32
drivers/net/wireless/realtek/rtlwifi/ps.c:867:42: warning: restricted __le32 degrades to integer
drivers/net/wireless/realtek/rtlwifi/ps.c:867:42: warning: cast to restricted __le32
drivers/net/wireless/realtek/rtlwifi/ps.c:870:42: warning: restricted __le32 degrades to integer
drivers/net/wireless/realtek/rtlwifi/ps.c:870:42: warning: cast to restricted __le32
drivers/net/wireless/realtek/rtlwifi/ps.c:873:42: warning: restricted __le32 degrades to integer
drivers/net/wireless/realtek/rtlwifi/ps.c:873:42: warning: cast to restricted __le32

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/realtek/rtlwifi/ps.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Kalle Valo July 15, 2020, 10:35 a.m. UTC | #1
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> Sparse reports the following endian issues:
> 
>   CHECK   drivers/net/wireless/realtek/rtlwifi/ps.c
> drivers/net/wireless/realtek/rtlwifi/ps.c:772:42: warning: restricted __le32 degrades to integer
> drivers/net/wireless/realtek/rtlwifi/ps.c:772:42: warning: cast to restricted __le32
> drivers/net/wireless/realtek/rtlwifi/ps.c:775:42: warning: restricted __le32 degrades to integer
> drivers/net/wireless/realtek/rtlwifi/ps.c:775:42: warning: cast to restricted __le32
> drivers/net/wireless/realtek/rtlwifi/ps.c:778:42: warning: restricted __le32 degrades to integer
> drivers/net/wireless/realtek/rtlwifi/ps.c:778:42: warning: cast to restricted __le32
> drivers/net/wireless/realtek/rtlwifi/ps.c:867:42: warning: restricted __le32 degrades to integer
> drivers/net/wireless/realtek/rtlwifi/ps.c:867:42: warning: cast to restricted __le32
> drivers/net/wireless/realtek/rtlwifi/ps.c:870:42: warning: restricted __le32 degrades to integer
> drivers/net/wireless/realtek/rtlwifi/ps.c:870:42: warning: cast to restricted __le32
> drivers/net/wireless/realtek/rtlwifi/ps.c:873:42: warning: restricted __le32 degrades to integer
> drivers/net/wireless/realtek/rtlwifi/ps.c:873:42: warning: cast to restricted __le32
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

2 patches applied to wireless-drivers-next.git, thanks.

0df9edb37f3c rtlwifi: Fix endian issue in ps.c
97794e638cf5 rtlwifi: rtl8188ee: Fix endian issue
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index bc0ac96ee615..90f92728e16a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -769,13 +769,13 @@  static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,
 					 *(u8 *)(ie + index);
 					index += 1;
 					p2pinfo->noa_duration[i] =
-					 le32_to_cpu(*(__le32 *)ie + index);
+					 le32_to_cpu(*(__le32 *)(ie + index));
 					index += 4;
 					p2pinfo->noa_interval[i] =
-					 le32_to_cpu(*(__le32 *)ie + index);
+					 le32_to_cpu(*(__le32 *)(ie + index));
 					index += 4;
 					p2pinfo->noa_start_time[i] =
-					 le32_to_cpu(*(__le32 *)ie + index);
+					 le32_to_cpu(*(__le32 *)(ie + index));
 					index += 4;
 				}
 
@@ -864,13 +864,13 @@  static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,
 					 *(u8 *)(ie + index);
 					index += 1;
 					p2pinfo->noa_duration[i] =
-					 le32_to_cpu(*(__le32 *)ie + index);
+					 le32_to_cpu(*(__le32 *)(ie + index));
 					index += 4;
 					p2pinfo->noa_interval[i] =
-					 le32_to_cpu(*(__le32 *)ie + index);
+					 le32_to_cpu(*(__le32 *)(ie + index));
 					index += 4;
 					p2pinfo->noa_start_time[i] =
-					 le32_to_cpu(*(__le32 *)ie + index);
+					 le32_to_cpu(*(__le32 *)(ie + index));
 					index += 4;
 				}