lkml.org 
[lkml]   [2017]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] irq_work: improve the flag definitions
On Mon, Aug 14, 2017 at 2:56 PM, Bartosz Golaszewski <brgl@bgdev.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.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2017-08-14 14:19    [W:0.090 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site