From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D077AC433DB for ; Wed, 27 Jan 2021 03:36:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5B3B206DB for ; Wed, 27 Jan 2021 03:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233984AbhA0Dfe (ORCPT ); Tue, 26 Jan 2021 22:35:34 -0500 Received: from mga03.intel.com ([134.134.136.65]:28539 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbhAZVm0 (ORCPT ); Tue, 26 Jan 2021 16:42:26 -0500 IronPort-SDR: MiwA8nk4u/Wx3XPWn5+t8yySlth1VoHXdW3npTD6M5Age7TA5lVL4oZqU7DwoptrrlPD4Hhylt M8tF0pAD7n6w== X-IronPort-AV: E=McAfee;i="6000,8403,9876"; a="180056047" X-IronPort-AV: E=Sophos;i="5.79,377,1602572400"; d="scan'208";a="180056047" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2021 13:40:40 -0800 IronPort-SDR: qczsz0GdS8UyERkoUgJ3RsxHff1rgU2LT/qG13+0GA4/lXFeASMXrJXhzTMIN0hHnHthCkPaH0 dWTNxI+777dA== X-IronPort-AV: E=Sophos;i="5.79,377,1602572400"; d="scan'208";a="410299123" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2021 13:40:37 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1l4W5j-00Ewq5-OO; Tue, 26 Jan 2021 23:41:39 +0200 Date: Tue, 26 Jan 2021 23:41:39 +0200 From: Andy Shevchenko To: Paul Gortmaker Cc: linux-kernel@vger.kernel.org, lizefan@huawei.com, mingo@kernel.org, tglx@linutronix.de, josh@joshtriplett.org, yury.norov@gmail.com, peterz@infradead.org, paulmck@kernel.org, fweisbec@gmail.com, linux@rasmusvillemoes.dk Subject: Re: [PATCH 6/8] lib: bitmap: support "N" as an alias for size of bitmap Message-ID: References: <20210126171141.122639-1-paul.gortmaker@windriver.com> <20210126171141.122639-7-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 11:37:30PM +0200, Andy Shevchenko wrote: > On Tue, Jan 26, 2021 at 12:11:39PM -0500, Paul Gortmaker wrote: ... > > + if (str[0] == 'N') { > > + *num = nbits - 1; > > + return str + 1; > > + } > > But locating it here makes possible to enter a priori invalid input, like N for > start of the region. > > I think this should be separate helper which is called in places where it makes > sense. Okay, N is 31 on 32 core system... It is a bit counter intuitive, because it's rather _L_ast than _N_umber of CPUs. Changing letter? -- With Best Regards, Andy Shevchenko