public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] ACPI: PMIC: Use sizeof() instead of hard coded value
@ 2022-08-30 13:55 Andy Shevchenko
  2022-08-30 13:55 ` [PATCH v1 2/2] ACPI: PMIC: Replace open coded be16_to_cpu() Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andy Shevchenko @ 2022-08-30 13:55 UTC (permalink / raw)
  To: Andy Shevchenko, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown, Andy Shevchenko, Mika Westerberg

It's better to use sizeof() of a given buffer than spreading
a hard coded value.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/pmic/intel_pmic_chtdc_ti.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-30 16:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-30 13:55 [PATCH v1 1/2] ACPI: PMIC: Use sizeof() instead of hard coded value Andy Shevchenko
2022-08-30 13:55 ` [PATCH v1 2/2] ACPI: PMIC: Replace open coded be16_to_cpu() Andy Shevchenko
2022-08-30 16:06   ` Mika Westerberg
2022-08-30 16:37     ` Andy Shevchenko
2022-08-30 16:10   ` kernel test robot
2022-08-30 15:14 ` [PATCH v1 1/2] ACPI: PMIC: Use sizeof() instead of hard coded value Andy Shevchenko
2022-08-30 15:57 ` Mika Westerberg
2022-08-30 16:10   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox