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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06430ECAAD1 for ; Wed, 31 Aug 2022 09:35:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229453AbiHaJfA (ORCPT ); Wed, 31 Aug 2022 05:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiHaJe7 (ORCPT ); Wed, 31 Aug 2022 05:34:59 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34AAD21E3B; Wed, 31 Aug 2022 02:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661938499; x=1693474499; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=070umHQFjooRmGQhFXHyxmtD9BFsD5IdNnJ+i1kO9sE=; b=NAJhfO5RqDhr673AHcICkoscoMu5l6oQnQHM6LmvTKey85H/yinYd5fp rANf90K/uOlqHxTtBGlite4obPuMYcL65DBmtCcVpfn4j9eC4Dekavaqk Ao72LQWoM/Wgj5IcntD3mDNgamgXcpEpFA+iHPXVZf2D/3R/sIuFInERl geB3QFWix8N2WlxJ9QPg5AP835Er5mtRj5R/b/bDcFeskFfITBiVuc4sR A7vcRRjaQAfF7iPcI52nLbQDKaB12kmf/LnVb+uyAw3L3c8fDzmLEaw++ yZspCqZXssBT7PNq1KiiM2h30KAfI6Svd3lAgSO+Fy22dWElBpTuhDO+8 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10455"; a="292987752" X-IronPort-AV: E=Sophos;i="5.93,277,1654585200"; d="scan'208";a="292987752" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 02:34:58 -0700 X-IronPort-AV: E=Sophos;i="5.93,277,1654585200"; d="scan'208";a="562981000" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 02:34:56 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oTK7a-006JYQ-0R; Wed, 31 Aug 2022 12:34:54 +0300 Date: Wed, 31 Aug 2022 12:34:53 +0300 From: Andy Shevchenko To: Mika Westerberg Cc: Hans de Goede , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Andy Shevchenko Subject: Re: [PATCH v2 2/3] ACPI: PMIC: Replace open coded be16_to_cpu() Message-ID: References: <20220830171155.42962-1-andriy.shevchenko@linux.intel.com> <20220830171155.42962-2-andriy.shevchenko@linux.intel.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-acpi@vger.kernel.org On Wed, Aug 31, 2022 at 08:43:54AM +0300, Mika Westerberg wrote: > On Tue, Aug 30, 2022 at 08:11:54PM +0300, Andy Shevchenko wrote: > > -#define VR_MODE_DISABLED 0 > > -#define VR_MODE_AUTO BIT(0) > > -#define VR_MODE_NORMAL BIT(1) > > -#define VR_MODE_SWITCH BIT(2) > > -#define VR_MODE_ECO (BIT(0)|BIT(1)) > > +#define PMIC_REG_MASK GENMASK(11, 0) > > + > > +#define VR_MODE_DISABLED (0 << 0) > > +#define VR_MODE_AUTO (1 << 0) > > +#define VR_MODE_NORMAL (2 << 0) > > +#define VR_MODE_ECO (3 << 0) > > +#define VR_MODE_SWITCH (4 << 0) > > IMHO this one is worse than what it was. I'm not sure why. Here is obvious wrong use of BIT() macro against plain numbers. I can split it into a separate change with an explanation of why it's better. But I think it doesn't worth the churn. > Anyway, that's just a nitpick. The other parts look good, > > Reviewed-by: Mika Westerberg Thanks! -- With Best Regards, Andy Shevchenko