Re: [PATCH v2] gpio: gpio-imx-scu: Use ARRAY_SIZE for array length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 10, 2023 at 10:46 AM <coolrrsh@xxxxxxxxx> wrote:
>
> From: Rajeshwar R Shinde <coolrrsh@xxxxxxxxx>
>
> Use of macro ARRAY_SIZE to calculate array size minimizes
> the redundant code and improves code reusability.
> This fixes warnings reported by Coccinelle:
> drivers/gpio/gpio-imx-scu.c:106:32-33: WARNING: Use ARRAY_SIZE

...

> -       gc->ngpio = sizeof(scu_rsrc_arr)/sizeof(unsigned int);
> +       gc->ngpio = ARRAY_SIZE(scu_rsrc_arr);

And you need to include kernel.h for this.

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux