Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp569739rwe; Wed, 31 Aug 2022 07:28:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR6opY+U6ZADF3cFTeZ2YjszvwyqD/WNde1TsDVI3gaGQzGR/5PNRj760U6GGmmMQdn3W4Ay X-Received: by 2002:a17:902:b48f:b0:172:b57e:f0ff with SMTP id y15-20020a170902b48f00b00172b57ef0ffmr26225945plr.25.1661956104424; Wed, 31 Aug 2022 07:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661956104; cv=none; d=google.com; s=arc-20160816; b=w0dIrwd0anmAYarPJD8vN0IoDFs7H0j4YU4Eecyyai699dfD74ltK+XpwVtCBhilVu KMT2r9x5ak4TdeaSmb4e9dedDXNt4/DbPZIddO8j5OrS83mwn7YQz52zpiNyZUNTlH8N 5IqbA4xXRNzeUCrH/QhgsK/twKWrtpX8JtNHGYIsZCe7HFIiGj9h7cvoYj+yhv0Y72eV hT+fqv4rW4x9juk5AHtMtR+s5p0+ZGcyUarfor/2bB2vgdi7GvGU1hDQRVX3jAXBa+zT yK8zNejBXE8KEHpYN1tsRfmwkdHgF07x4dCirmHI9azzY3hiVpJMrigdY8EP6aUcSwTF 9A8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=joCY4MxaX0Mx4xrQ3HxptUDtx4ZuRGd0TnY0hmB9Kyo=; b=eHNg04eAQlKlEbjxTMfmD8fp/XHbA7gmuAMUnJAXgKz6NAq7vX8Gxi51WHbSV2EAj4 NrPY6dkSQa/Tqzf9Uxo0pMl7YKtCAJ0CLF9LY/Zxco/4YZJ5eoCHIFDXgUmTRa3Tmhdc KPdWzlensPm1gA3lLBNgN0Ec1hBFkAlXndrEpuR9eb//gyFGJM/90FF9o9ghW3QB2n97 sBl/j+X65nirdjftfCRWjEJmdz042fsjjZzYu3uenSi+pTMtuYS9czJfY/TE1hJWaTr2 qL0DRZHy2BqeU6SycyZ3n8I0SDWlG8vvfV/ytFTjHGyLGsEusMtjp7WjBrML5t0sG8Pp 4jPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V0V0LK8S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw1-20020a056a00450100b0052fd43eb49fsi13066221pfb.260.2022.08.31.07.28.13; Wed, 31 Aug 2022 07:28:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V0V0LK8S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbiHaN5t (ORCPT + 99 others); Wed, 31 Aug 2022 09:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiHaN5k (ORCPT ); Wed, 31 Aug 2022 09:57:40 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB90D5EAD; Wed, 31 Aug 2022 06:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661954259; x=1693490259; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dtL+8Cys9Oexa2+abpB8VdNGZHy6gFiiShpIowTcEGw=; b=V0V0LK8SS/I5/3znce7CCRCSZKnVpae2CWsNsoUOlpA1sRaXNY8FMwwf SCey28JGP+b6kq7YfIRAfnBgwHDDLoaFZMWb+gDUfiHo2R6XaM2zXbQKv +RnsA2cH4G7X9ifNLAzUqjbZBgBQ+qzp5zjBFhLTAjk8VTsZVUQ2y9oMp 6BV8PAVtRQMRBEWDsUtuL3u/+zzSYjTVSyo5w6CnBBe+OxXEHKMjqB5cK H1TDzt092ay+PiM0VbWil0hgdSrxOU2+XIzFvHROfP9slxF4Okj/QjQ7q G+DMalPG4HN3/FnquOqvslW1GC3s+1hfBQ2VgepyBjtXamqGRshA9MxSL Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="381748176" X-IronPort-AV: E=Sophos;i="5.93,278,1654585200"; d="scan'208";a="381748176" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 06:57:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,278,1654585200"; d="scan'208";a="940441946" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 31 Aug 2022 06:57:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DEFB1174; Wed, 31 Aug 2022 16:57:50 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Andy Shevchenko , Mika Westerberg , Hans de Goede Subject: [PATCH v3 1/3] ACPI: PMIC: Use sizeof() instead of hard coded value Date: Wed, 31 Aug 2022 16:57:47 +0300 Message-Id: <20220831135749.78743-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's better to use sizeof() of a given buffer than spreading a hard coded value. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- v3: added tag (Mika) drivers/acpi/pmic/intel_pmic_chtdc_ti.c | 2 +- drivers/acpi/pmic/intel_pmic_xpower.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pmic/intel_pmic_chtdc_ti.c b/drivers/acpi/pmic/intel_pmic_chtdc_ti.c index 418eec523025..6c2a6da430ed 100644 --- a/drivers/acpi/pmic/intel_pmic_chtdc_ti.c +++ b/drivers/acpi/pmic/intel_pmic_chtdc_ti.c @@ -87,7 +87,7 @@ static int chtdc_ti_pmic_get_raw_temp(struct regmap *regmap, int reg) { u8 buf[2]; - if (regmap_bulk_read(regmap, reg, buf, 2)) + if (regmap_bulk_read(regmap, reg, buf, sizeof(buf))) return -EIO; /* stored in big-endian */ diff --git a/drivers/acpi/pmic/intel_pmic_xpower.c b/drivers/acpi/pmic/intel_pmic_xpower.c index 61bbe4c24d87..33c5e85294cd 100644 --- a/drivers/acpi/pmic/intel_pmic_xpower.c +++ b/drivers/acpi/pmic/intel_pmic_xpower.c @@ -255,7 +255,7 @@ static int intel_xpower_pmic_get_raw_temp(struct regmap *regmap, int reg) if (ret) return ret; - ret = regmap_bulk_read(regmap, AXP288_GP_ADC_H, buf, 2); + ret = regmap_bulk_read(regmap, AXP288_GP_ADC_H, buf, sizeof(buf)); if (ret == 0) ret = (buf[0] << 4) + ((buf[1] >> 4) & 0x0f); -- 2.35.1