Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D0F8C433EF for ; Mon, 22 Nov 2021 11:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239101AbhKVLbY (ORCPT ); Mon, 22 Nov 2021 06:31:24 -0500 Received: from mga05.intel.com ([192.55.52.43]:61569 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232948AbhKVLbV (ORCPT ); Mon, 22 Nov 2021 06:31:21 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10175"; a="320994495" X-IronPort-AV: E=Sophos;i="5.87,254,1631602800"; d="scan'208";a="320994495" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2021 03:28:15 -0800 X-IronPort-AV: E=Sophos;i="5.87,254,1631602800"; d="scan'208";a="596254092" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2021 03:28:12 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mp7UW-009Ps2-73; Mon, 22 Nov 2021 13:28:08 +0200 Date: Mon, 22 Nov 2021 13:28:07 +0200 From: Andy Shevchenko To: Matti Vaittinen Cc: Matti Vaittinen , Liam Girdwood , Mark Brown , Jiri Kosina , Andrew Morton , Yury Norov , Kumar Kartikeya Dwivedi , Rasmus Villemoes , Geert Uytterhoeven , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] bitops: Add single_bit_set() Message-ID: References: <73d5e4286282a47b614d1cc5631eb9ff2a7e2b44.1637330431.git.matti.vaittinen@fi.rohmeurope.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73d5e4286282a47b614d1cc5631eb9ff2a7e2b44.1637330431.git.matti.vaittinen@fi.rohmeurope.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 Mon, Nov 22, 2021 at 01:03:25PM +0200, Matti Vaittinen wrote: > There are cases when it is useful to check a bit-mask has only one bit > set. Add a generic helper for it instead of baking own one for each > user. > > Signed-off-by: Matti Vaittinen > --- > I am not at all sure what would be the best place for this. Please let > me know if you think some other file would be more appropriate. So, you decided to reinvent hamming weight... Please, drop this patch and use corresponding hweight() call. -- With Best Regards, Andy Shevchenko