From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753210AbdHNMTe (ORCPT ); Mon, 14 Aug 2017 08:19:34 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:35360 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753089AbdHNMTd (ORCPT ); Mon, 14 Aug 2017 08:19:33 -0400 MIME-Version: 1.0 In-Reply-To: <20170814115647.21955-1-brgl@bgdev.pl> References: <20170814115647.21955-1-brgl@bgdev.pl> From: Andy Shevchenko Date: Mon, 14 Aug 2017 15:19:32 +0300 Message-ID: Subject: Re: [PATCH] irq_work: improve the flag definitions To: Bartosz Golaszewski Cc: Thomas Gleixner , Marc Zyngier , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 14, 2017 at 2:56 PM, Bartosz Golaszewski 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