lkml.org 
[lkml]   [2020]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1 3/5] gpio: max77620: Replace interrupt-enable array with bitmap
From
Date
08.07.2020 11:44, Andy Shevchenko пишет:
> On Wed, Jul 8, 2020 at 11:30 AM Dmitry Osipenko <digetx@gmail.com> wrote:
>>
>> There is no need to dedicate an array where a bitmap could be used.
>> Let's replace the interrupt's enable-array with the enable-mask in order
>> to improve the code a tad.
>
> ...
>
>> +#include <linux/bitops.h>
>
>> unsigned int irq_type[MAX77620_GPIO_NR];
>> - bool irq_enabled[MAX77620_GPIO_NR];
>> + unsigned long irq_enb_mask;
>
> I would rather to move to DECLARE_BITMAP()
> (the macro is defined in types.h IIRC)
>

Hello, Andy! I know about DECLARE_BITMAP(), it is a very useful macro
for bitmaps that are over 32 bits, which is absolutely not the case
here. This macro will make code more difficult to read and then we will
have to use the bitmap API, which is unnecessary overhead for this case,
and thus, it won't be an improvement anymore, IMO.

I'd either keep this patch as-is or drop it.

\
 
 \ /
  Last update: 2020-07-08 11:09    [W:0.053 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site