Re: [PATCH v5 1/2] staging: rtl8192e: rename tables in r8192e_hwimg.c

From: Dan Carpenter
Date: Thu Nov 10 2022 - 06:24:17 EST


Look at how these defines are used. Take RTL8192E_PHY_REG_ARRAY_LEN
as an example.

On Thu, Nov 10, 2022 at 09:35:10PM +1100, Jacob Bai wrote:
> +u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN] = {0x0,};
> +#define RTL8192E_PHY_REG_ARRAY_LEN 1
> +extern u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN];
> +#define PHY_REGArrayLength RTL8192E_PHY_REG_ARRAY_LEN

It's only used to create the PHY_REGArrayLength define. Layers upon
layers of indirection. Get rid of the RTL8192E_PHY_REG_ARRAY_LEN
completely just do:

#define PHY_REGArrayLength 1

Except get rid of that as well and use ARRAY_SIZE().

What I'm saying is don't send a v6 of this patch. Just step back and
try to figure out how to get rid of all this code instead of renaming
the variable.s

regars,
dan carpenter