#define COMPARE_ADDR(a,i) (i2c_no_probes[(i)] == (a))
#define NO_PROBE_ADDR(i) i2c_no_probes[(i)]
#endif /* defined(CONFIG_SYS_I2C) */
-
-#define NUM_ELEMENTS_NOPROBE (sizeof(i2c_no_probes)/sizeof(i2c_no_probes[0]))
#endif
#define DISP_LINE_LEN 16
#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;
#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));
}