Patchwork [U-Boot,1/3] hwmon: lm63: Use ARRAY_SIZE at appropriate place

login
register
mail settings
Submitter Axel Lin
Date June 22, 2013, 4:55 p.m.
Message ID <1371920114.31971.3.camel@phoenix>
Download mbox | patch
Permalink /patch/253419/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Axel Lin - June 22, 2013, 4:55 p.m.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/hwmon/lm63.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Tom Rini - June 26, 2013, 8:25 p.m.
On Sun, Jun 23, 2013 at 12:55:14AM +0800, Axel Lin wrote:

> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> 
> ---
> drivers/hwmon/lm63.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

This, along with the rest of the series is now applied to u-boot/master,
thanks!

Patch

diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index f3adf64..bb8e644 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -133,8 +133,7 @@  int dtt_init_one(int sensor)
 	/*
 	 * Setup PWM Lookup-Table
 	 */
-	for (i = 0; i < sizeof(pwm_lookup) / sizeof(struct pwm_lookup_entry);
-	     i++) {
+	for (i = 0; i < ARRAY_SIZE(pwm_lookup); i++) {
 		int address = DTT_PWM_LOOKUP_BASE + 2 * i;
 		val = pwm_lookup[i].temp;
 		if (is_lm64(sensor))