* [U-Boot] [PATCH] cmd_i2c: Use ARRAY_SIZE instead of reinventing it
@ 2013-06-22 13:56 Axel Lin
2013-06-25 0:54 ` Simon Glass
0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2013-06-22 13:56 UTC (permalink / raw)
To: u-boot
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
common/cmd_i2c.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 4380794..3215644 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -120,8 +120,6 @@ static uchar i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;
#define COMPARE_ADDR(a,i) (i2c_no_probes[(i)] == (a))
#define NO_PROBE_ADDR(i) i2c_no_probes[(i)]
#endif /* CONFIG_MULTI_BUS */
-
-#define NUM_ELEMENTS_NOPROBE (sizeof(i2c_no_probes)/sizeof(i2c_no_probes[0]))
#endif
#if defined(CONFIG_I2C_MUX)
@@ -713,7 +711,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
#if defined(CONFIG_SYS_I2C_NOPROBES)
skip = 0;
- for (k=0; k < NUM_ELEMENTS_NOPROBE; k++) {
+ for (k = 0; k < ARRAY_SIZE(i2c_no_probes); k++) {
if (COMPARE_BUS(bus, k) && COMPARE_ADDR(j, k)) {
skip = 1;
break;
@@ -731,7 +729,7 @@ static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
#if defined(CONFIG_SYS_I2C_NOPROBES)
puts ("Excluded chip addresses:");
- for (k=0; k < NUM_ELEMENTS_NOPROBE; k++) {
+ for (k = 0; k < ARRAY_SIZE(i2c_no_probes); k++) {
if (COMPARE_BUS(bus,k))
printf(" %02X", NO_PROBE_ADDR(k));
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] cmd_i2c: Use ARRAY_SIZE instead of reinventing it
2013-06-22 13:56 [U-Boot] [PATCH] cmd_i2c: Use ARRAY_SIZE instead of reinventing it Axel Lin
@ 2013-06-25 0:54 ` Simon Glass
2013-06-25 1:15 ` Axel Lin
0 siblings, 1 reply; 3+ messages in thread
From: Simon Glass @ 2013-06-25 0:54 UTC (permalink / raw)
To: u-boot
On Sat, Jun 22, 2013 at 6:56 AM, Axel Lin <axel.lin@ingics.com> wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>
Missing commit message?
Otherwise:
Acked-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] cmd_i2c: Use ARRAY_SIZE instead of reinventing it
2013-06-25 0:54 ` Simon Glass
@ 2013-06-25 1:15 ` Axel Lin
0 siblings, 0 replies; 3+ messages in thread
From: Axel Lin @ 2013-06-25 1:15 UTC (permalink / raw)
To: u-boot
2013/6/25 Simon Glass <sjg@chromium.org>:
> On Sat, Jun 22, 2013 at 6:56 AM, Axel Lin <axel.lin@ingics.com> wrote:
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>
>
> Missing commit message?
Because the subject line is already very clear.
And tools/checkpatch.pl does not complaint.
>
> Otherwise:
>
> Acked-by: Simon Glass <sjg@chromium.org>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-25 1:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-22 13:56 [U-Boot] [PATCH] cmd_i2c: Use ARRAY_SIZE instead of reinventing it Axel Lin
2013-06-25 0:54 ` Simon Glass
2013-06-25 1:15 ` Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.