]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: rtl8723au: hal: Use macro ARRAY_SIZE
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Thu, 18 Feb 2016 19:30:13 +0000 (01:00 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 23:04:11 +0000 (15:04 -0800)
The macro ARRAY_SIZE is more concise to use instead of dividing
size of the array by the size of its type.

Changes were made using Coccinelle.

@@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/HalHWImg8723A_RF.c

index dbf571e8b908599d2cb138ccc6879e4d2610019f..286f3ea3d263ae3b72a7e4351caa8f3f362561b7 100644 (file)
@@ -215,7 +215,7 @@ void ODM_ReadAndConfig_RadioA_1T_8723A(struct dm_odm_t *pDM_Odm)
        u32     i           = 0;
        u8     platform    = 0x04;
        u8     board       = pDM_Odm->BoardType;
-       u32     ArrayLen    = sizeof(Array_RadioA_1T_8723A)/sizeof(u32);
+       u32     ArrayLen    = ARRAY_SIZE(Array_RadioA_1T_8723A);
        u32 *Array = Array_RadioA_1T_8723A;
 
        hex += board;