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 9AB0AC433E0 for ; Wed, 10 Feb 2021 16:40:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C03E64E8C for ; Wed, 10 Feb 2021 16:40:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233011AbhBJQkp (ORCPT ); Wed, 10 Feb 2021 11:40:45 -0500 Received: from mga02.intel.com ([134.134.136.20]:53826 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232775AbhBJQgQ (ORCPT ); Wed, 10 Feb 2021 11:36:16 -0500 IronPort-SDR: KqWcc+wr7Es+q1o/mSTzl9OBEi67/isTJhFjzM+aIRfU8VyrqixnjP1POQkDQg1L5CAWW6KAeh tdT9yFr9XL/w== X-IronPort-AV: E=McAfee;i="6000,8403,9891"; a="169229824" X-IronPort-AV: E=Sophos;i="5.81,168,1610438400"; d="scan'208";a="169229824" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 08:34:30 -0800 IronPort-SDR: 1+Iqsu8B9On0PFXd2+gZ52R1GgxtlUnuIkFW3ywEl7dLoedQUn6/nIrpdIKgp+y5kmWiJG64en DqHlMoCCV4tg== X-IronPort-AV: E=Sophos;i="5.81,168,1610438400"; d="scan'208";a="488798529" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 08:34:27 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1l9sRc-003lvx-Ju; Wed, 10 Feb 2021 18:34:24 +0200 Date: Wed, 10 Feb 2021 18:34:24 +0200 From: Andy Shevchenko To: Paul Gortmaker Cc: linux-kernel@vger.kernel.org, Li Zefan , Ingo Molnar , Yury Norov , Thomas Gleixner , Josh Triplett , Peter Zijlstra , "Paul E. McKenney" , Frederic Weisbecker , Rasmus Villemoes Subject: Re: [PATCH 5/8] lib: bitmap: pair nbits value with region struct Message-ID: References: <20210209225907.78405-1-paul.gortmaker@windriver.com> <20210209225907.78405-6-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209225907.78405-6-paul.gortmaker@windriver.com> 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, Feb 09, 2021 at 05:59:04PM -0500, Paul Gortmaker wrote: > A region is a standalone entity to some degree, but it needs to > be paired with a bitmap width in order to set context and determine > if the region even fits into the width of the bitmap. > > This will reduce parameter passing and enable using nbits as part > of future dynamic region parameter parsing. ... > +struct bitmap_region { > + struct region *r; Why do we need it as a pointer? > + unsigned int nbits; > +}; ... > struct region r; > + struct bitmap_region br; > + br.r = &r; > + br.nbits = nmaskbits; I thought about simply struct bitmap_region br; br.nbits = nmaskbits; -- With Best Regards, Andy Shevchenko