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 751B8C433EF for ; Mon, 22 Nov 2021 11:49:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239427AbhKVLwO (ORCPT ); Mon, 22 Nov 2021 06:52:14 -0500 Received: from mga12.intel.com ([192.55.52.136]:58977 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239423AbhKVLwG (ORCPT ); Mon, 22 Nov 2021 06:52:06 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10175"; a="214799269" X-IronPort-AV: E=Sophos;i="5.87,254,1631602800"; d="scan'208";a="214799269" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2021 03:48:57 -0800 X-IronPort-AV: E=Sophos;i="5.87,254,1631602800"; d="scan'208";a="589277118" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2021 03:48:54 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mp7oX-009Q9O-Sp; Mon, 22 Nov 2021 13:48:49 +0200 Date: Mon, 22 Nov 2021 13:48:49 +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 3/4] regulators: irq_helper: Provide helper for trivial IRQ notifications Message-ID: References: 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 Mon, Nov 22, 2021 at 01:04:12PM +0200, Matti Vaittinen wrote: > Provide a generic map_event helper for regulators which have a notification > IRQ with single, well defined purpose. Eg, IRQ always indicates exactly one > event for exactly one regulator device. For such IRQs the mapping is > trivial. ... > + int err = rid->states[0].possible_errs; I would rather make it unsigned, but anyway... > + !single_bit_set(err, sizeof(err) * 8))) hweight32() seems suitable here. -- With Best Regards, Andy Shevchenko