From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Andy Shevchenko <andy@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH v1 1/2] ACPI: PMIC: Use sizeof() instead of hard coded value
Date: Tue, 30 Aug 2022 16:55:31 +0300 [thread overview]
Message-ID: <20220830135532.28992-1-andriy.shevchenko@linux.intel.com> (raw)
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
next reply other threads:[~2022-08-30 13:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 13:55 Andy Shevchenko [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220830135532.28992-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox