linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
@ 2021-08-16 17:35 Aakash Hemadri
  2021-08-16 17:35 ` [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment Aakash Hemadri
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Aakash Hemadri @ 2021-08-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

This patchset fixes the below sparse warnings

rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
rtw_security.c:72:50:    expected restricted __le32 [usertype]
rtw_security.c:72:50:    got unsigned int
rtw_security.c:80:50: warning: incorrect type in assignment (different base types)
rtw_security.c:80:50:    expected restricted __le32 [usertype]
rtw_security.c:80:50:    got unsigned int
rtw_security.c:124:33: warning: cast to restricted __le32
rtw_security.c:509:58: warning: incorrect type in assignment (different base types)
rtw_security.c:509:58:    expected restricted __le32 [usertype]
rtw_security.c:509:58:    got unsigned int
rtw_security.c:517:58: warning: incorrect type in assignment (different base types)
rtw_security.c:517:58:    expected restricted __le32 [usertype]
rtw_security.c:517:58:    got unsigned int
rtw_security.c:621:41: warning: cast to restricted __le32

This can be applied cleanly on next-20210816, and is compile tested.

Please ignore the duplicate of this patchset, I did not CC staging.
Message ID: <cover.1629134725.git.aakashhemadri123@gmail.com>

Aakash Hemadri (2):
  staging: rtl8732bs: incorrect type in assignment
  staging: rtl8723bs: cast to restricted __le32

 drivers/staging/rtl8723bs/core/rtw_security.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment
  2021-08-16 17:35 [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Aakash Hemadri
@ 2021-08-16 17:35 ` Aakash Hemadri
  2021-08-16 22:43   ` kernel test robot
  2021-08-16 17:35 ` [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32 Aakash Hemadri
  2021-08-16 18:48 ` [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Fabio M. De Francesco
  2 siblings, 1 reply; 12+ messages in thread
From: Aakash Hemadri @ 2021-08-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

Cast u32 to __le32 with __cpu_to_le32 to fix sparse warning:

warning: incorrect type in assignment (different base types)
expected restricted __le32 [usertype]
got unsigned int

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index a99f439328f1..381deeea99d0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -8,6 +8,7 @@
 #include <drv_types.h>
 #include <rtw_debug.h>
 #include <crypto/aes.h>
+#include <linux/byteorder/little_endian.h>
 
 static const char * const _security_type_str[] = {
 	"N/A",
@@ -69,7 +70,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
 
 				length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
 
-				*((__le32 *)crc) = ~crc32_le(~0, payload, length);
+				*((__le32 *)crc) = __cpu_to_le32(~crc32_le(~0, payload, length));
 
 				arc4_setkey(ctx, wepkey, 3 + keylength);
 				arc4_crypt(ctx, payload, payload, length);
@@ -77,7 +78,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
 
 			} else {
 				length = pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
-				*((__le32 *)crc) = ~crc32_le(~0, payload, length);
+				*((__le32 *)crc) = __cpu_to_le32(~crc32_le(~0, payload, length));
 				arc4_setkey(ctx, wepkey, 3 + keylength);
 				arc4_crypt(ctx, payload, payload, length);
 				arc4_crypt(ctx, payload + length, crc, 4);
@@ -506,7 +507,8 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
 
 				if ((curfragnum+1) == pattrib->nr_frags) {	/* 4 the last fragment */
 					length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
-					*((__le32 *)crc) = ~crc32_le(~0, payload, length);
+					*((__le32 *)crc) =
+						__cpu_to_le32(~crc32_le(~0, payload, length));
 
 					arc4_setkey(ctx, rc4key, 16);
 					arc4_crypt(ctx, payload, payload, length);
@@ -514,7 +516,8 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
 
 				} else {
 					length = pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
-					*((__le32 *)crc) = ~crc32_le(~0, payload, length);
+					*((__le32 *)crc) =
+						__cpu_to_le32(~crc32_le(~0, payload, length));
 
 					arc4_setkey(ctx, rc4key, 16);
 					arc4_crypt(ctx, payload, payload, length);
-- 
2.32.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32
  2021-08-16 17:35 [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Aakash Hemadri
  2021-08-16 17:35 ` [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment Aakash Hemadri
@ 2021-08-16 17:35 ` Aakash Hemadri
  2021-08-19  9:43   ` David Laight
  2021-08-16 18:48 ` [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Fabio M. De Francesco
  2 siblings, 1 reply; 12+ messages in thread
From: Aakash Hemadri @ 2021-08-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

Fix sparse warning:
warning: cast to restricted __le32

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 381deeea99d0..5320b1a46dfb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -122,7 +122,7 @@ void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
 		arc4_crypt(ctx, payload, payload,  length);
 
 		/* calculate icv and compare the icv */
-		*((u32 *)crc) = le32_to_cpu(~crc32_le(~0, payload, length - 4));
+		*((u32 *)crc) = ~crc32_le(~0, payload, length - 4);
 
 	}
 }
@@ -621,7 +621,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
 			arc4_setkey(ctx, rc4key, 16);
 			arc4_crypt(ctx, payload, payload, length);
 
-			*((u32 *)crc) = le32_to_cpu(~crc32_le(~0, payload, length - 4));
+			*((u32 *)crc) = ~crc32_le(~0, payload, length - 4);
 
 			if (crc[3] != payload[length - 1] || crc[2] != payload[length - 2] ||
 			    crc[1] != payload[length - 3] || crc[0] != payload[length - 4])
-- 
2.32.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
  2021-08-16 17:35 [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Aakash Hemadri
  2021-08-16 17:35 ` [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment Aakash Hemadri
  2021-08-16 17:35 ` [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32 Aakash Hemadri
@ 2021-08-16 18:48 ` Fabio M. De Francesco
  2021-08-18  5:58   ` Fabio M. De Francesco
  2 siblings, 1 reply; 12+ messages in thread
From: Fabio M. De Francesco @ 2021-08-16 18:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Aakash Hemadri
  Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

On Monday, August 16, 2021 7:35:05 PM CEST Aakash Hemadri wrote:
> This patchset fixes the below sparse warnings
> 
> rtw_security.c:72:50: warning: incorrect type in assignment (different base 
types)
> rtw_security.c:72:50:    expected restricted __le32 [usertype]
> rtw_security.c:72:50:    got unsigned int
>
> [...]
> 
> This can be applied cleanly on next-20210816, and is compile tested.

This warnings have been fixed time ago against staging-testing:
please see commit aef1c966a364.

Thanks,

Fabio

> Please ignore the duplicate of this patchset, I did not CC staging.
> Message ID: <cover.1629134725.git.aakashhemadri123@gmail.com>
> 
> Aakash Hemadri (2):
>   staging: rtl8732bs: incorrect type in assignment
>   staging: rtl8723bs: cast to restricted __le32
> 
>  drivers/staging/rtl8723bs/core/rtw_security.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment
  2021-08-16 17:35 ` [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment Aakash Hemadri
@ 2021-08-16 22:43   ` kernel test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2021-08-16 22:43 UTC (permalink / raw)
  To: Aakash Hemadri, Greg Kroah-Hartman
  Cc: kbuild-all, Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 37212 bytes --]

Hi Aakash,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.14-rc6]
[cannot apply to staging/staging-testing next-20210816]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Aakash-Hemadri/staging-rtl8732bs-Fix-sparse-warnings/20210817-013634
base:    7c60610d476766e128cc4284bb6349732cbd6606
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e416b56afe8ba715b03a7a058ee5424be5fe97f8
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Aakash-Hemadri/staging-rtl8732bs-Fix-sparse-warnings/20210817-013634
        git checkout e416b56afe8ba715b03a7a058ee5424be5fe97f8
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash drivers/staging/rtl8723bs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:15: warning: "__constant_htonl" redefined
      15 | #define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:15: note: this is the location of the previous definition
      15 | #define __constant_htonl(x) ((__force __be32)(__u32)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:16: warning: "__constant_ntohl" redefined
      16 | #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:16: note: this is the location of the previous definition
      16 | #define __constant_ntohl(x) ((__force __u32)(__be32)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:17: warning: "__constant_htons" redefined
      17 | #define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:17: note: this is the location of the previous definition
      17 | #define __constant_htons(x) ((__force __be16)(__u16)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:18: warning: "__constant_ntohs" redefined
      18 | #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:18: note: this is the location of the previous definition
      18 | #define __constant_ntohs(x) ((__force __u16)(__be16)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:19: warning: "__constant_cpu_to_le64" redefined
      19 | #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:19: note: this is the location of the previous definition
      19 | #define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:20: warning: "__constant_le64_to_cpu" redefined
      20 | #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:20: note: this is the location of the previous definition
      20 | #define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:21: warning: "__constant_cpu_to_le32" redefined
      21 | #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:21: note: this is the location of the previous definition
      21 | #define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:22: warning: "__constant_le32_to_cpu" redefined
      22 | #define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:22: note: this is the location of the previous definition
      22 | #define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:23: warning: "__constant_cpu_to_le16" redefined
      23 | #define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:23: note: this is the location of the previous definition
      23 | #define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:24: warning: "__constant_le16_to_cpu" redefined
      24 | #define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:24: note: this is the location of the previous definition
      24 | #define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:25: warning: "__constant_cpu_to_be64" redefined
      25 | #define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:25: note: this is the location of the previous definition
      25 | #define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:26: warning: "__constant_be64_to_cpu" redefined
      26 | #define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:26: note: this is the location of the previous definition
      26 | #define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:27: warning: "__constant_cpu_to_be32" redefined
      27 | #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:27: note: this is the location of the previous definition
      27 | #define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:28: warning: "__constant_be32_to_cpu" redefined
      28 | #define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:28: note: this is the location of the previous definition
      28 | #define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:29: warning: "__constant_cpu_to_be16" redefined
      29 | #define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:29: note: this is the location of the previous definition
      29 | #define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:30: warning: "__constant_be16_to_cpu" redefined
      30 | #define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:30: note: this is the location of the previous definition
      30 | #define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:31: warning: "__cpu_to_le64" redefined
      31 | #define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:31: note: this is the location of the previous definition
      31 | #define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:32: warning: "__le64_to_cpu" redefined
      32 | #define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:32: note: this is the location of the previous definition
      32 | #define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:33: warning: "__cpu_to_le32" redefined
      33 | #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:33: note: this is the location of the previous definition
      33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
>> include/uapi/linux/byteorder/little_endian.h:34: warning: "__le32_to_cpu" redefined
      34 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:34: note: this is the location of the previous definition
      34 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
   include/uapi/linux/byteorder/little_endian.h:35: warning: "__cpu_to_le16" redefined
      35 | #define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:35: note: this is the location of the previous definition
      35 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
   include/uapi/linux/byteorder/little_endian.h:36: warning: "__le16_to_cpu" redefined
      36 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:36: note: this is the location of the previous definition
      36 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
   include/uapi/linux/byteorder/little_endian.h:37: warning: "__cpu_to_be64" redefined
      37 | #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:37: note: this is the location of the previous definition
      37 | #define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
   include/uapi/linux/byteorder/little_endian.h:38: warning: "__be64_to_cpu" redefined
      38 | #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,
                    from drivers/staging/rtl8723bs/include/drv_types.h:17,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   include/uapi/linux/byteorder/big_endian.h:38: note: this is the location of the previous definition
      38 | #define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
         | 
   In file included from include/linux/byteorder/little_endian.h:5,
                    from drivers/staging/rtl8723bs/core/rtw_security.c:11:
   include/uapi/linux/byteorder/little_endian.h:39: warning: "__cpu_to_be32" redefined
      39 | #define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
         | 
   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/parisc/include/uapi/asm/byteorder.h:5,
                    from arch/parisc/include/asm/bitops.h:11,
                    from include/linux/bitops.h:32,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/sched/signal.h:5,


vim +/__cpu_to_le64p +44 include/uapi/linux/byteorder/little_endian.h

5921e6f8809b16 David Howells  2012-10-13   14  
5921e6f8809b16 David Howells  2012-10-13  @15  #define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
5921e6f8809b16 David Howells  2012-10-13  @16  #define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
5921e6f8809b16 David Howells  2012-10-13  @17  #define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
5921e6f8809b16 David Howells  2012-10-13  @18  #define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
5921e6f8809b16 David Howells  2012-10-13  @19  #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
5921e6f8809b16 David Howells  2012-10-13  @20  #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
5921e6f8809b16 David Howells  2012-10-13  @21  #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
5921e6f8809b16 David Howells  2012-10-13  @22  #define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
5921e6f8809b16 David Howells  2012-10-13  @23  #define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
5921e6f8809b16 David Howells  2012-10-13  @24  #define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
5921e6f8809b16 David Howells  2012-10-13  @25  #define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
5921e6f8809b16 David Howells  2012-10-13  @26  #define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
5921e6f8809b16 David Howells  2012-10-13  @27  #define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
5921e6f8809b16 David Howells  2012-10-13  @28  #define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells  2012-10-13  @29  #define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
5921e6f8809b16 David Howells  2012-10-13  @30  #define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
5921e6f8809b16 David Howells  2012-10-13  @31  #define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
5921e6f8809b16 David Howells  2012-10-13  @32  #define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
5921e6f8809b16 David Howells  2012-10-13  @33  #define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
5921e6f8809b16 David Howells  2012-10-13  @34  #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
5921e6f8809b16 David Howells  2012-10-13  @35  #define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
5921e6f8809b16 David Howells  2012-10-13  @36  #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
5921e6f8809b16 David Howells  2012-10-13  @37  #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
5921e6f8809b16 David Howells  2012-10-13  @38  #define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
5921e6f8809b16 David Howells  2012-10-13  @39  #define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
5921e6f8809b16 David Howells  2012-10-13  @40  #define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells  2012-10-13  @41  #define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
5921e6f8809b16 David Howells  2012-10-13  @42  #define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
5921e6f8809b16 David Howells  2012-10-13   43  
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @44  static __always_inline __le64 __cpu_to_le64p(const __u64 *p)
5921e6f8809b16 David Howells  2012-10-13   45  {
5921e6f8809b16 David Howells  2012-10-13   46  	return (__force __le64)*p;
5921e6f8809b16 David Howells  2012-10-13   47  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @48  static __always_inline __u64 __le64_to_cpup(const __le64 *p)
5921e6f8809b16 David Howells  2012-10-13   49  {
5921e6f8809b16 David Howells  2012-10-13   50  	return (__force __u64)*p;
5921e6f8809b16 David Howells  2012-10-13   51  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @52  static __always_inline __le32 __cpu_to_le32p(const __u32 *p)
5921e6f8809b16 David Howells  2012-10-13   53  {
5921e6f8809b16 David Howells  2012-10-13   54  	return (__force __le32)*p;
5921e6f8809b16 David Howells  2012-10-13   55  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @56  static __always_inline __u32 __le32_to_cpup(const __le32 *p)
5921e6f8809b16 David Howells  2012-10-13   57  {
5921e6f8809b16 David Howells  2012-10-13   58  	return (__force __u32)*p;
5921e6f8809b16 David Howells  2012-10-13   59  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @60  static __always_inline __le16 __cpu_to_le16p(const __u16 *p)
5921e6f8809b16 David Howells  2012-10-13   61  {
5921e6f8809b16 David Howells  2012-10-13   62  	return (__force __le16)*p;
5921e6f8809b16 David Howells  2012-10-13   63  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @64  static __always_inline __u16 __le16_to_cpup(const __le16 *p)
5921e6f8809b16 David Howells  2012-10-13   65  {
5921e6f8809b16 David Howells  2012-10-13   66  	return (__force __u16)*p;
5921e6f8809b16 David Howells  2012-10-13   67  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @68  static __always_inline __be64 __cpu_to_be64p(const __u64 *p)
5921e6f8809b16 David Howells  2012-10-13   69  {
5921e6f8809b16 David Howells  2012-10-13   70  	return (__force __be64)__swab64p(p);
5921e6f8809b16 David Howells  2012-10-13   71  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @72  static __always_inline __u64 __be64_to_cpup(const __be64 *p)
5921e6f8809b16 David Howells  2012-10-13   73  {
5921e6f8809b16 David Howells  2012-10-13   74  	return __swab64p((__u64 *)p);
5921e6f8809b16 David Howells  2012-10-13   75  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @76  static __always_inline __be32 __cpu_to_be32p(const __u32 *p)
5921e6f8809b16 David Howells  2012-10-13   77  {
5921e6f8809b16 David Howells  2012-10-13   78  	return (__force __be32)__swab32p(p);
5921e6f8809b16 David Howells  2012-10-13   79  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @80  static __always_inline __u32 __be32_to_cpup(const __be32 *p)
5921e6f8809b16 David Howells  2012-10-13   81  {
5921e6f8809b16 David Howells  2012-10-13   82  	return __swab32p((__u32 *)p);
5921e6f8809b16 David Howells  2012-10-13   83  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @84  static __always_inline __be16 __cpu_to_be16p(const __u16 *p)
5921e6f8809b16 David Howells  2012-10-13   85  {
5921e6f8809b16 David Howells  2012-10-13   86  	return (__force __be16)__swab16p(p);
5921e6f8809b16 David Howells  2012-10-13   87  }
bc27fb68aaad44 Denys Vlasenko 2016-03-17  @88  static __always_inline __u16 __be16_to_cpup(const __be16 *p)
5921e6f8809b16 David Howells  2012-10-13   89  {
5921e6f8809b16 David Howells  2012-10-13   90  	return __swab16p((__u16 *)p);
5921e6f8809b16 David Howells  2012-10-13   91  }
5921e6f8809b16 David Howells  2012-10-13  @92  #define __cpu_to_le64s(x) do { (void)(x); } while (0)
5921e6f8809b16 David Howells  2012-10-13  @93  #define __le64_to_cpus(x) do { (void)(x); } while (0)
5921e6f8809b16 David Howells  2012-10-13  @94  #define __cpu_to_le32s(x) do { (void)(x); } while (0)
5921e6f8809b16 David Howells  2012-10-13  @95  #define __le32_to_cpus(x) do { (void)(x); } while (0)
5921e6f8809b16 David Howells  2012-10-13  @96  #define __cpu_to_le16s(x) do { (void)(x); } while (0)
5921e6f8809b16 David Howells  2012-10-13  @97  #define __le16_to_cpus(x) do { (void)(x); } while (0)
5921e6f8809b16 David Howells  2012-10-13  @98  #define __cpu_to_be64s(x) __swab64s((x))
5921e6f8809b16 David Howells  2012-10-13  @99  #define __be64_to_cpus(x) __swab64s((x))
5921e6f8809b16 David Howells  2012-10-13 @100  #define __cpu_to_be32s(x) __swab32s((x))
5921e6f8809b16 David Howells  2012-10-13 @101  #define __be32_to_cpus(x) __swab32s((x))
5921e6f8809b16 David Howells  2012-10-13 @102  #define __cpu_to_be16s(x) __swab16s((x))
5921e6f8809b16 David Howells  2012-10-13 @103  #define __be16_to_cpus(x) __swab16s((x))
5921e6f8809b16 David Howells  2012-10-13  104  
5921e6f8809b16 David Howells  2012-10-13  105  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 68576 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
  2021-08-16 18:48 ` [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Fabio M. De Francesco
@ 2021-08-18  5:58   ` Fabio M. De Francesco
  0 siblings, 0 replies; 12+ messages in thread
From: Fabio M. De Francesco @ 2021-08-18  5:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Aakash Hemadri
  Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

On Monday, August 16, 2021 8:48:48 PM CEST Fabio M. De Francesco wrote:
> On Monday, August 16, 2021 7:35:05 PM CEST Aakash Hemadri wrote:
> > This patchset fixes the below sparse warnings
> >
> > [...]
> >
> This warnings have been fixed time ago against staging-testing:
> please see commit aef1c966a364.

Hi Aakash,

I see at least two of your messages never made it to
linux-staging list because the address is incorrect (you did not write in CC
linux-staging@lists.linux.dev, instead you used the nonexistent
linux-staging@vger.kernel.org):

https://lore.kernel.org/lkml/20210818044200.tvpr4j5vcaimexsn@xps.yggdrasil/
https://lore.kernel.org/lkml/20210818044049.yd7tnjvj3j4j3ddb@xps.yggdrasil/

Please, send them again to the correct address.

Thanks,

Fabio



^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32
  2021-08-16 17:35 ` [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32 Aakash Hemadri
@ 2021-08-19  9:43   ` David Laight
  0 siblings, 0 replies; 12+ messages in thread
From: David Laight @ 2021-08-19  9:43 UTC (permalink / raw)
  To: 'Aakash Hemadri', Greg Kroah-Hartman
  Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

From: Aakash Hemadri
> Sent: 16 August 2021 18:35
> 
> Fix sparse warning:
> warning: cast to restricted __le32

How many different copies of this crappy copy are there?
> 
...
> diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c
> b/drivers/staging/rtl8723bs/core/rtw_security.c
> index 381deeea99d0..5320b1a46dfb 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_security.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_security.c
> @@ -122,7 +122,7 @@ void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
>  		arc4_crypt(ctx, payload, payload,  length);
> 
>  		/* calculate icv and compare the icv */
> -		*((u32 *)crc) = le32_to_cpu(~crc32_le(~0, payload, length - 4));
> +		*((u32 *)crc) = ~crc32_le(~0, payload, length - 4);

You've removed a byteswap which is needed on BE architectures.

>  	}
>  }
> @@ -621,7 +621,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
>  			arc4_setkey(ctx, rc4key, 16);
>  			arc4_crypt(ctx, payload, payload, length);
> 
> -			*((u32 *)crc) = le32_to_cpu(~crc32_le(~0, payload, length - 4));
> +			*((u32 *)crc) = ~crc32_le(~0, payload, length - 4);
> 
>  			if (crc[3] != payload[length - 1] || crc[2] != payload[length - 2] ||
>  			    crc[1] != payload[length - 3] || crc[0] != payload[length - 4])

As above - crc32_le() does a 'little-endian crc' but returns a host-ordered value.
The (horrid) array cast means you need to store a LE value.

There are a dozen better ways to do this - I'm bored of quoting them.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
  2021-08-17 19:10   ` Fabio M. De Francesco
@ 2021-08-18  4:42     ` Aakash Hemadri
  0 siblings, 0 replies; 12+ messages in thread
From: Aakash Hemadri @ 2021-08-18  4:42 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Greg Kroah-Hartman, Shuah Khan, Bjorn Helgaas, linux-staging,
	linux-kernel

On 21/08/17 09:10PM, Fabio M. De Francesco wrote:
> On Tuesday, August 17, 2021 7:54:11 PM CEST Greg Kroah-Hartman wrote:
> > On Mon, Aug 16, 2021 at 11:00:41PM +0530, Aakash Hemadri wrote:
> > > This patchset fixes the below sparse warnings
> > > 
> > > rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
> > > rtw_security.c:72:50:    expected restricted __le32 [usertype]
> > > rtw_security.c:72:50:    got unsigned int
> > >
> > > [...]
> > 
> > This series does not apply to my tree at all.  Please fix up and rebase
> > and resubmit, after reading the mailing list archives for others that
> > have attempted do do this type of work in the past for this issue.
> > 
> > It is not a trivial change that is needed...
> 
> Dear Greg,
> 
> As I've already pointed out in another message of this thread, your tree has 
> already these sparse warnings fixed by me with commit aef1c966a364 (that 
> you applied with a "much nicer!" comment).
> 
> So, when Aakash rebases against your current tree, he will not anymore see
> those sparse warnings.

Thanks for the patch Fabio! Will rebase and work on something new!

Thanks,
Aakash Hemadri

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
  2021-08-17 17:54 ` Greg Kroah-Hartman
  2021-08-17 19:10   ` Fabio M. De Francesco
@ 2021-08-18  4:40   ` Aakash Hemadri
  1 sibling, 0 replies; 12+ messages in thread
From: Aakash Hemadri @ 2021-08-18  4:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

On 21/08/17 07:54PM, Greg Kroah-Hartman wrote:
> This series does not apply to my tree at all.  Please fix up and rebase
> and resubmit, after reading the mailing list archives for others that
> have attempted do do this type of work in the past for this issue.
> 
> It is not a trivial change that is needed...

Will check what went wrong, and see what I can do.

Thanks,
Aakash Hemadri

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
  2021-08-17 17:54 ` Greg Kroah-Hartman
@ 2021-08-17 19:10   ` Fabio M. De Francesco
  2021-08-18  4:42     ` Aakash Hemadri
  2021-08-18  4:40   ` Aakash Hemadri
  1 sibling, 1 reply; 12+ messages in thread
From: Fabio M. De Francesco @ 2021-08-17 19:10 UTC (permalink / raw)
  To: Aakash Hemadri, Greg Kroah-Hartman
  Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

On Tuesday, August 17, 2021 7:54:11 PM CEST Greg Kroah-Hartman wrote:
> On Mon, Aug 16, 2021 at 11:00:41PM +0530, Aakash Hemadri wrote:
> > This patchset fixes the below sparse warnings
> > 
> > rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
> > rtw_security.c:72:50:    expected restricted __le32 [usertype]
> > rtw_security.c:72:50:    got unsigned int
> >
> > [...]
> 
> This series does not apply to my tree at all.  Please fix up and rebase
> and resubmit, after reading the mailing list archives for others that
> have attempted do do this type of work in the past for this issue.
> 
> It is not a trivial change that is needed...

Dear Greg,

As I've already pointed out in another message of this thread, your tree has 
already these sparse warnings fixed by me with commit aef1c966a364 (that 
you applied with a "much nicer!" comment).

So, when Aakash rebases against your current tree, he will not anymore see
those sparse warnings.

Thanks,

Fabio


> 
> thanks,
> 
> greg k-h
> 





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
  2021-08-16 17:30 Aakash Hemadri
@ 2021-08-17 17:54 ` Greg Kroah-Hartman
  2021-08-17 19:10   ` Fabio M. De Francesco
  2021-08-18  4:40   ` Aakash Hemadri
  0 siblings, 2 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-17 17:54 UTC (permalink / raw)
  To: Aakash Hemadri; +Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

On Mon, Aug 16, 2021 at 11:00:41PM +0530, Aakash Hemadri wrote:
> This patchset fixes the below sparse warnings
> 
> rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
> rtw_security.c:72:50:    expected restricted __le32 [usertype]
> rtw_security.c:72:50:    got unsigned int
> rtw_security.c:80:50: warning: incorrect type in assignment (different base types)
> rtw_security.c:80:50:    expected restricted __le32 [usertype]
> rtw_security.c:80:50:    got unsigned int
> rtw_security.c:124:33: warning: cast to restricted __le32
> rtw_security.c:509:58: warning: incorrect type in assignment (different base types)
> rtw_security.c:509:58:    expected restricted __le32 [usertype]
> rtw_security.c:509:58:    got unsigned int
> rtw_security.c:517:58: warning: incorrect type in assignment (different base types)
> rtw_security.c:517:58:    expected restricted __le32 [usertype]
> rtw_security.c:517:58:    got unsigned int
> rtw_security.c:621:41: warning: cast to restricted __le32
> 
> This can be applied cleanly on next-20210816, and is compile tested.
> 
> Aakash Hemadri (2):
>   staging: rtl8732bs: incorrect type in assignment
>   staging: rtl8723bs: cast to restricted __le32
> 
>  rtw_security.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)

This series does not apply to my tree at all.  Please fix up and rebase
and resubmit, after reading the mailing list archives for others that
have attempted do do this type of work in the past for this issue.

It is not a trivial change that is needed...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings
@ 2021-08-16 17:30 Aakash Hemadri
  2021-08-17 17:54 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 12+ messages in thread
From: Aakash Hemadri @ 2021-08-16 17:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Shuah Khan, Bjorn Helgaas, linux-staging, linux-kernel

This patchset fixes the below sparse warnings

rtw_security.c:72:50: warning: incorrect type in assignment (different base types)
rtw_security.c:72:50:    expected restricted __le32 [usertype]
rtw_security.c:72:50:    got unsigned int
rtw_security.c:80:50: warning: incorrect type in assignment (different base types)
rtw_security.c:80:50:    expected restricted __le32 [usertype]
rtw_security.c:80:50:    got unsigned int
rtw_security.c:124:33: warning: cast to restricted __le32
rtw_security.c:509:58: warning: incorrect type in assignment (different base types)
rtw_security.c:509:58:    expected restricted __le32 [usertype]
rtw_security.c:509:58:    got unsigned int
rtw_security.c:517:58: warning: incorrect type in assignment (different base types)
rtw_security.c:517:58:    expected restricted __le32 [usertype]
rtw_security.c:517:58:    got unsigned int
rtw_security.c:621:41: warning: cast to restricted __le32

This can be applied cleanly on next-20210816, and is compile tested.

Aakash Hemadri (2):
  staging: rtl8732bs: incorrect type in assignment
  staging: rtl8723bs: cast to restricted __le32

 rtw_security.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-08-19  9:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 17:35 [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Aakash Hemadri
2021-08-16 17:35 ` [PATCH 1/2] staging: rtl8732bs: incorrect type in assignment Aakash Hemadri
2021-08-16 22:43   ` kernel test robot
2021-08-16 17:35 ` [PATCH 2/2] staging: rtl8723bs: fix cast to restricted __le32 Aakash Hemadri
2021-08-19  9:43   ` David Laight
2021-08-16 18:48 ` [PATCH 0/2] staging: rtl8732bs: Fix sparse warnings Fabio M. De Francesco
2021-08-18  5:58   ` Fabio M. De Francesco
  -- strict thread matches above, loose matches on Subject: below --
2021-08-16 17:30 Aakash Hemadri
2021-08-17 17:54 ` Greg Kroah-Hartman
2021-08-17 19:10   ` Fabio M. De Francesco
2021-08-18  4:42     ` Aakash Hemadri
2021-08-18  4:40   ` Aakash Hemadri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).