Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp672910lqt; Thu, 6 Jun 2024 15:12:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoe0ooLToAo/1mtLLC6wPfbjX5y9VinRaTj0B2E15fbh5cUFg3dD0slWLt8y8vBUbuDgk6Y/TME6lZuySJUV/IR2b2/H/Gr3fQMukHUA== X-Google-Smtp-Source: AGHT+IHtqgAmSdh4ek3MM4zJix6/k6k/8lVMb8A6axLJlEyM/F1YHkKdp8sSfuRcxTUzswuu4EiV X-Received: by 2002:a05:6512:3128:b0:52b:8280:8c10 with SMTP id 2adb3069b0e04-52bb9f6f575mr532922e87.18.1717711978686; Thu, 06 Jun 2024 15:12:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717711978; cv=pass; d=google.com; s=arc-20160816; b=FOdZwU91ThsCKyxNk2RB5kvS5xHE6eC64rWr+08DT8EV+Si1GP/1VmhJCeDikG7ifg BDFCgAw7JifTgavRBeX2L96rTn+OVj6IQocZRuNdksy7KMJK6WTrI77h9kXZDcy44gqu yVkiascDDqqnMyOchMHguiNCzKdp/ymMUyUCtLUTnoLY4St/PFQeYpmaPsVQi4a065Ca /q+4CMInDKyHK7BTxx9j6DAN9o3zyhOTQWhAnhB+xgnvlFyxh30GCPFCRLspWRfPoPgR PIVi0ERgIZX/s3Z4hMKLbOoDfYMI9yQPGJ970L2n35Ea8W4iNvwC8cG0eaQl9JfiIRSz pv+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6N6VGjFF8svsG69tOvDOed18ppy3HuBYJZuXxHt7Quc=; fh=OAx35mhqT7w49CH4c7T09ig2LJq7E8PsKb2Beisg6Ag=; b=iLBBDpaXlKTiGC8LivDP7MXwmVBKKhkVwuFo9tcJ1xtcLH0JzUYAfRR1/GrPmnJFJ4 szzBOrkMPBsc1kcX82XYRXPwyQ3gpNcmFCHggdOEmOIIYQAZYoWhybJas+d0V9pKqAx7 vVR8P180B70YcNqcwKsuIg2K9fI2QHWCa+AzqYe1sXij8txSU/m/SaYZh8QOBaXLPnl6 8dToqjCVDvyx87fTYVo/cxVNiVcyH4JlL/KzNLCiTaV/F4GSPed/Dm4Jb5uZkjibbK6W uxcz+m/izHO8AMjxnbH1LweJ61zqmkWf3qLB2Gsgb1cf+vQMtkYqoaeDxoJ0nWEgkTwS zanw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="n1NVa/OF"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-205016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c806d81f5si110463466b.369.2024.06.06.15.12.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 15:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="n1NVa/OF"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-205016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 277721F2304B for ; Thu, 6 Jun 2024 20:57:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 285B21990A7; Thu, 6 Jun 2024 20:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="n1NVa/OF" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F17D413A40F; Thu, 6 Jun 2024 20:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717707445; cv=none; b=q2mo4N2XTyB7chDsoH5Z0QJZxrM2fQxskLWmkMyaBy2yX3BbQ7Zb+Vojfrc9cReR2i5vfRgIr1fumoaqEkg/DTCrk1zq7EtYFbyBHXX0uTiCi1rmchQo0wjsxr84CVt0BziRighFUsFYv+w999LMWprZ+mtKUjbTjn1ecDhvpww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717707445; c=relaxed/simple; bh=LdMVV7VYjMW/QGtJELET0s9Ow3c8JeYwxFjxuDpdc1I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ccWAwJ6gwll4NTHtdOk+z1kphp/1T4f1aHExF823qqcS13R3HJBzBThNLskgGAyLjHzPtpai/VuQ2WHSMs61A0dC2rpKWRNZ38xfjfkYkA6pKAIt51WhLEPIvjoRgHaw/QN849Y9l1BP8dYOnt17tRZgGPULCpssIA58vsB0FK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=n1NVa/OF; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717707444; x=1749243444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LdMVV7VYjMW/QGtJELET0s9Ow3c8JeYwxFjxuDpdc1I=; b=n1NVa/OFNJmqbCwvwTHnAlEr2uGX9r9tejZDIx5x3yzVuGZ/K1z0/hBZ 3LNhTr0bHU/IVgqdTR3kE+9LVwAZTGhLQj0090DLeO4KqpRtxypJHzF2R 0xNtdInqxnwaTrnJP3uyjpltBJb3hzuWCgKCwveIGMij5T59KuJiUO33A roPmySORCOo8p3NhvS9aWw06wmnrXO6Ys2Enzh9Bs/ZGp6iQttquceJzT S2cw2iiK0e8dYkEB4Xpuu10DmNune5UyDxwA3ABUfDTgfesbwfiNPe3qM GlzGG2bU3BzeK3geBbkeFQPMDUJWG7Gkt6nwWcdKDt4qNCFhu5u7rb3W7 A==; X-CSE-ConnectionGUID: eTsRbNaISamf2w24eWj59g== X-CSE-MsgGUID: ufW2pL5jRBmQJO0eGyAcOA== X-IronPort-AV: E=McAfee;i="6600,9927,11095"; a="25037096" X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="25037096" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 13:57:21 -0700 X-CSE-ConnectionGUID: 520WyKoZReKiXykETOskaA== X-CSE-MsgGUID: NUIPwQjTQZaMlnGwMWS0RA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="61304491" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa002.fm.intel.com with ESMTP; 06 Jun 2024 13:57:19 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6B4A6F7; Thu, 06 Jun 2024 23:57:18 +0300 (EEST) From: Andy Shevchenko To: Mika Westerberg , Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Andy Shevchenko , Hans de Goede Subject: [PATCH v4 1/3] ACPI: PMIC: Use sizeof() instead of hard coded value Date: Thu, 6 Jun 2024 23:54:14 +0300 Message-ID: <20240606205712.3187675-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240606205712.3187675-1-andriy.shevchenko@linux.intel.com> References: <20240606205712.3187675-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 c84ef3d15181..35744a0307aa 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.43.0.rc1.1336.g36b5255a03ac