[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VfmnY1u2d4UX1qoKALqE--3+CUSGn9oDudCPZDa_-0GTA@mail.gmail.com>
Date: Thu, 10 Aug 2023 13:40:23 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: coolrrsh@...il.com
Cc: linus.walleij@...aro.org, brgl@...ev.pl, andy@...nel.org,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH v2] gpio: gpio-imx-scu: Use ARRAY_SIZE for array length
On Thu, Aug 10, 2023 at 10:46 AM <coolrrsh@...il.com> wrote:
>
> From: Rajeshwar R Shinde <coolrrsh@...il.com>
>
> 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
Powered by blists - more mailing lists