mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ACPI: PMIC: Use sizeof() instead of hard coded value
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> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
83a7eefedc
commit
58e04f3152
2 changed files with 2 additions and 2 deletions
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue