lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=Mf9Xn4E=iPpVBdQe_6mUG4JQBmt7gL41kOpvbjYWX8pOQ@mail.gmail.com>
Date:   Mon, 14 Aug 2017 19:12:16 +0200
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Marc Zyngier <marc.zyngier@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] irq_work: improve the flag definitions

2017-08-14 14:19 GMT+02:00 Andy Shevchenko <andy.shevchenko@...il.com>:
> On Mon, Aug 14, 2017 at 2:56 PM, Bartosz Golaszewski <brgl@...ev.pl> wrote:
>> IRQ_WORK_FLAGS is defined simply to 3UL. This is confusing as it
>> says nothing about its purpose. Define IRQ_WORK_FLAGS as a bitwise
>> OR of IRQ_WORK_PENDING and IRQ_WORK_BUSY.
>>
>> While we're at it: use the BIT() macro for all flags.
>
>> +#define IRQ_WORK_PENDING       BIT(0)
>> +#define IRQ_WORK_BUSY          BIT(1)
>> +#define IRQ_WORK_FLAGS         (IRQ_WORK_PENDING | IRQ_WORK_BUSY)
>
> I dunno which style is preferred, though I would go with simple
> GENMASK() here, as all definitions right on left :-)
>
> Parameters of GENMASK will show last-first entries and can be easily decoded.
> Although there are only two for now.
>

Which is a good enough reason to not over-complicate things and just
use an easy to decipher bitwise OR. ;)

Thanks,
Bartosz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ