[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve_zxp4_N_YzzvJ=H8Qs65G5j7bgGBv_TvsZ6Ye2nuECA@mail.gmail.com>
Date: Mon, 26 Feb 2018 16:45:41 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Mathieu Malaterre <malat@...ian.org>
Cc: Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Jiri Slaby <jslaby@...e.com>,
"open list:LINUX FOR POWERPC PA SEMI PWRFICIENT"
<linuxppc-dev@...ts.ozlabs.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 01/21] powerpc: Remove warning on array size when empty
On Mon, Feb 26, 2018 at 4:44 PM, Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Sun, Feb 25, 2018 at 7:22 PM, Mathieu Malaterre <malat@...ian.org> wrote:
>> static void __init check_cpu_feature_properties(unsigned long node)
>> {
>> - unsigned long i;
>> struct feature_property *fp = feature_properties;
>> const __be32 *prop;
>>
>
> Much simpler is just add
>
> if (ARRAY_SIZE() == 0)
> return;
>
>> - for (i = 0; i < ARRAY_SIZE(feature_properties); ++i, ++fp) {
>> + for (; fp != feature_properties + ARRAY_SIZE(feature_properties); ++fp) {
...or convert to while(), which will be more readable.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists