diff mbox series

leds: lp8860: Write full EEPROM, not only half of it

Message ID 20241114101402.2562878-1-alexander.sverdlin@siemens.com
State New
Headers show
Series leds: lp8860: Write full EEPROM, not only half of it | expand

Commit Message

Sverdlin, Alexander Nov. 14, 2024, 10:13 a.m. UTC
From: Alexander Sverdlin <alexander.sverdlin@siemens.com>

I struggle to explain dividing an ARRAY_SIZE() by the size of an element
once again. As the latter equals to 2, only the half of EEPROM was ever
written. Drop the unexplainable division and write full ARRAY_SIZE().

Cc: stable@vger.kernel.org
Fixes: 7a8685accb95 ("leds: lp8860: Introduce TI lp8860 4 channel LED driver")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
This is based on code review only, I don't have LP8860 to test.

 drivers/leds/leds-lp8860.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lee Jones Dec. 11, 2024, 12:19 p.m. UTC | #1
On Thu, 14 Nov 2024 11:13:59 +0100, A. Sverdlin wrote:
> I struggle to explain dividing an ARRAY_SIZE() by the size of an element
> once again. As the latter equals to 2, only the half of EEPROM was ever
> written. Drop the unexplainable division and write full ARRAY_SIZE().
> 
> 

Applied, thanks!

[1/1] leds: lp8860: Write full EEPROM, not only half of it
      commit: 0d2e820a86793595e2a776855d04701109e46663

--
Lee Jones [李琼斯]
diff mbox series

Patch

diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index 7a136fd817206..06196d851ade7 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -265,7 +265,7 @@  static int lp8860_init(struct lp8860_led *led)
 		goto out;
 	}
 
-	reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs) / sizeof(lp8860_eeprom_disp_regs[0]);
+	reg_count = ARRAY_SIZE(lp8860_eeprom_disp_regs);
 	for (i = 0; i < reg_count; i++) {
 		ret = regmap_write(led->eeprom_regmap,
 				lp8860_eeprom_disp_regs[i].reg,