From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755660AbZD0MLj (ORCPT ); Mon, 27 Apr 2009 08:11:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753682AbZD0ML3 (ORCPT ); Mon, 27 Apr 2009 08:11:29 -0400 Received: from brick.kernel.dk ([93.163.65.50]:49468 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753750AbZD0ML3 (ORCPT ); Mon, 27 Apr 2009 08:11:29 -0400 Date: Mon, 27 Apr 2009 14:11:28 +0200 From: Jens Axboe To: Nikanth Karthikesan Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Cleanup: Remove unused __REQ_NR_BITS from enum rq_flag_bits Message-ID: <20090427121128.GB4593@kernel.dk> References: <200904271705.30550.knikanth@suse.de> <20090427114633.GA4593@kernel.dk> <200904271735.02007.knikanth@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904271735.02007.knikanth@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27 2009, Nikanth Karthikesan wrote: > On Monday 27 April 2009 17:16:33 Jens Axboe wrote: > > On Mon, Apr 27 2009, Nikanth Karthikesan wrote: > > > The __REQ_NR_BITS was being used by blk_dump_rq_flags() long back, while > > > printing the individual request flag bits as strings to limit to the used > > > bits. But it does not use it now. Remove unused enum. > > > > > > Signed-off-by: Nikanth Karthikesan > > > > > > --- > > > > > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > > > index ba54c83..f41abbb 100644 > > > --- a/include/linux/blkdev.h > > > +++ b/include/linux/blkdev.h > > > @@ -118,7 +118,6 @@ enum rq_flag_bits { > > > __REQ_COPY_USER, /* contains copies of user pages */ > > > __REQ_INTEGRITY, /* integrity metadata has been remapped */ > > > __REQ_NOIDLE, /* Don't anticipate more IO after this one */ > > > - __REQ_NR_BITS, /* stops here */ > > > }; > > > > > > #define REQ_RW (1 << __REQ_RW) > > > > Lets turn it into something useful instead. It's meant to catch someone > > adding too many flags, how about something like this: > > > > Untested ;-) > > > > diff --git a/block/blk-core.c b/block/blk-core.c > > index d73eb76..e62ef94 100644 > > --- a/block/blk-core.c > > +++ b/block/blk-core.c > > @@ -2159,6 +2159,8 @@ EXPORT_SYMBOL(kblockd_schedule_work); > > > > int __init blk_dev_init(void) > > { > > + BUILD_BUG_ON(__REQ_NR_BITS > 8 * sizeof(int)); > > + > > kblockd_workqueue = create_workqueue("kblockd"); > > if (!kblockd_workqueue) > > panic("Failed to create kblockd\n"); > > Good idea. How about this? That's fine, better explains the check. It doesn't matter in practice though, since we will be restricted to 32 flags even on 64-bit archs (as long as we support 32-bit archs). I'll add it, thanks. -- Jens Axboe