{"+ 5 V standby", "V", &sysmon_pic, NULL, NULL,
100, 1000, 0, 6040, 0xFF, 0xC8, 0xDE, 0, 0xC8, 0xDE, 0, 0x7C},
};
-static int sysmon_table_size = sizeof(sysmon_table) / sizeof(sysmon_table[0]);
+static int sysmon_table_size = ARRAY_SIZE(sysmon_table);
static int conversion_done = 0;
static int ctlr_list[][2] = { };
#endif
-#define CTRL_LIST_SIZE (sizeof(ctlr_list) / sizeof(ctlr_list[0]))
-
static struct {
void (*init) (int index);
void (*halt) (int index);
ctlr_proc[CTLR_SCC].send = scc_send;
ctlr_proc[CTLR_SCC].recv = scc_recv;
- for (i = 0; i < CTRL_LIST_SIZE; i++) {
+ for (i = 0; i < ARRAY_SIZE(ctlr_list); i++) {
if (test_ctlr (ctlr_list[i][0], ctlr_list[i][1]) != 0) {
res = -1;
}
{826, "MD_DBRAM1", 0x00000000, 0x00000000},
};
-static int spr_test_list_size =
- sizeof (spr_test_list) / sizeof (spr_test_list[0]);
+static int spr_test_list_size = ARRAY_SIZE(spr_test_list);
int spr_post_test (int flags)
{
static int ctlr_list[][2] = { };
#endif
-#define CTRL_LIST_SIZE (sizeof(ctlr_list) / sizeof(ctlr_list[0]))
-
static struct {
void (*init) (int index);
void (*halt) (int index);
ctlr_proc[CTLR_SCC].putc = scc_putc;
ctlr_proc[CTLR_SCC].getc = scc_getc;
- for (i = 0; i < CTRL_LIST_SIZE; i++) {
+ for (i = 0; i < ARRAY_SIZE(ctlr_list); i++) {
if (test_ctlr (ctlr_list[i][0], ctlr_list[i][1]) != 0) {
res = -1;
}
{0x3f3, "DBDR", 0x00000000, 0x00000000},
};
-static int spr_test_list_size =
- sizeof (spr_test_list) / sizeof (spr_test_list[0]);
+static int spr_test_list_size = ARRAY_SIZE(spr_test_list);
int spr_post_test (int flags)
{
static int memory_post_dataline(unsigned long long * pmem)
{
unsigned long long temp64 = 0;
- int num_patterns = sizeof(pattern)/ sizeof(pattern[0]);
+ int num_patterns = ARRAY_SIZE(pattern);
int i;
unsigned int hi, lo, pathi, patlo;
int ret = 0;
0x80000000
},
};
-static unsigned int cpu_post_andi_size =
- sizeof (cpu_post_andi_table) / sizeof (struct cpu_post_andi_s);
+static unsigned int cpu_post_andi_size = ARRAY_SIZE(cpu_post_andi_table);
int cpu_post_test_andi (void)
{
0x04
},
};
-static unsigned int cpu_post_cmp_size =
- sizeof (cpu_post_cmp_table) / sizeof (struct cpu_post_cmp_s);
+static unsigned int cpu_post_cmp_size = ARRAY_SIZE(cpu_post_cmp_table);
int cpu_post_test_cmp (void)
{
0x04
},
};
-static unsigned int cpu_post_cmpi_size =
- sizeof (cpu_post_cmpi_table) / sizeof (struct cpu_post_cmpi_s);
+static unsigned int cpu_post_cmpi_size = ARRAY_SIZE(cpu_post_cmpi_table);
int cpu_post_test_cmpi (void)
{
0xaaaaaaaa,
0x55555555,
};
-static unsigned int cpu_post_cr_size1 =
- sizeof (cpu_post_cr_table1) / sizeof (ulong);
+static unsigned int cpu_post_cr_size1 = ARRAY_SIZE(cpu_post_cr_table1);
static struct cpu_post_cr_s2 {
ulong xer;
5
},
};
-static unsigned int cpu_post_cr_size2 =
- sizeof (cpu_post_cr_table2) / sizeof (struct cpu_post_cr_s2);
+static unsigned int cpu_post_cr_size2 = ARRAY_SIZE(cpu_post_cr_table2);
static struct cpu_post_cr_s3 {
ulong cr;
0x71234567
},
};
-static unsigned int cpu_post_cr_size3 =
- sizeof (cpu_post_cr_table3) / sizeof (struct cpu_post_cr_s3);
+static unsigned int cpu_post_cr_size3 = ARRAY_SIZE(cpu_post_cr_table3);
static struct cpu_post_cr_s4 {
ulong cmd;
0x0000ffff
},
};
-static unsigned int cpu_post_cr_size4 =
- sizeof (cpu_post_cr_table4) / sizeof (struct cpu_post_cr_s4);
+static unsigned int cpu_post_cr_size4 = ARRAY_SIZE(cpu_post_cr_table4);
int cpu_post_test_cr (void)
{
{
unsigned int i;
- for (i = 0; i < sizeof (expected) / sizeof (expected[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(expected); i++)
{
tstmul (expected[i].p1, expected[i].p2, expected[i].res);
tstmul (expected[i].p2, expected[i].p1, expected[i].res);
1
},
};
-static unsigned int cpu_post_load_size =
- sizeof (cpu_post_load_table) / sizeof (struct cpu_post_load_s);
+static unsigned int cpu_post_load_size = ARRAY_SIZE(cpu_post_load_table);
int cpu_post_test_load (void)
{
ASM_BLR,
};
- for (i = 0; i < sizeof(src) / sizeof(src[0]); i ++)
+ for (i = 0; i < ARRAY_SIZE(src); ++i)
{
src[i] = i;
dst[i] = 0;
0xffaaffff
},
};
-static unsigned int cpu_post_rlwimi_size =
- sizeof (cpu_post_rlwimi_table) / sizeof (struct cpu_post_rlwimi_s);
+static unsigned int cpu_post_rlwimi_size = ARRAY_SIZE(cpu_post_rlwimi_table);
int cpu_post_test_rlwimi (void)
{
0x0000ff00
},
};
-static unsigned int cpu_post_rlwinm_size =
- sizeof (cpu_post_rlwinm_table) / sizeof (struct cpu_post_rlwinm_s);
+static unsigned int cpu_post_rlwinm_size = ARRAY_SIZE(cpu_post_rlwinm_table);
int cpu_post_test_rlwinm (void)
{
0x0000ff00
},
};
-static unsigned int cpu_post_rlwnm_size =
- sizeof (cpu_post_rlwnm_table) / sizeof (struct cpu_post_rlwnm_s);
+static unsigned int cpu_post_rlwnm_size = ARRAY_SIZE(cpu_post_rlwnm_table);
int cpu_post_test_rlwnm (void)
{
0xf0000000
},
};
-static unsigned int cpu_post_srawi_size =
- sizeof (cpu_post_srawi_table) / sizeof (struct cpu_post_srawi_s);
+static unsigned int cpu_post_srawi_size = ARRAY_SIZE(cpu_post_srawi_table);
int cpu_post_test_srawi (void)
{
0xff
},
};
-static unsigned int cpu_post_store_size =
- sizeof (cpu_post_store_table) / sizeof (struct cpu_post_store_s);
+static unsigned int cpu_post_store_size = ARRAY_SIZE(cpu_post_store_table);
int cpu_post_test_store (void)
{
0x40
},
};
-static unsigned int cpu_post_three_size =
- sizeof (cpu_post_three_table) / sizeof (struct cpu_post_three_s);
+static unsigned int cpu_post_three_size = ARRAY_SIZE(cpu_post_three_table);
int cpu_post_test_three (void)
{
0xffff8000
},
};
-static unsigned int cpu_post_threei_size =
- sizeof (cpu_post_threei_table) / sizeof (struct cpu_post_threei_s);
+static unsigned int cpu_post_threei_size = ARRAY_SIZE(cpu_post_threei_table);
int cpu_post_test_threei (void)
{
0x1000
},
};
-static unsigned int cpu_post_threex_size =
- sizeof (cpu_post_threex_table) / sizeof (struct cpu_post_threex_s);
+static unsigned int cpu_post_threex_size = ARRAY_SIZE(cpu_post_threex_table);
int cpu_post_test_threex (void)
{
~5
},
};
-static unsigned int cpu_post_two_size =
- sizeof (cpu_post_two_table) / sizeof (struct cpu_post_two_s);
+static unsigned int cpu_post_two_size = ARRAY_SIZE(cpu_post_two_table);
int cpu_post_test_two (void)
{
12
},
};
-static unsigned int cpu_post_twox_size =
- sizeof (cpu_post_twox_table) / sizeof (struct cpu_post_twox_s);
+static unsigned int cpu_post_twox_size = ARRAY_SIZE(cpu_post_twox_table);
int cpu_post_test_twox (void)
{
POST_CRITICAL };
char *var[] = { "post_poweron", "post_normal", "post_slowtest",
"post_critical" };
- int varnum = sizeof (var) / sizeof (var[0]);
+ int varnum = ARRAY_SIZE(var);
char list[128]; /* long enough for POST list */
char *name;
char *s;
#endif
};
-unsigned int post_list_size = sizeof (post_list) / sizeof (struct post_test);
+unsigned int post_list_size = ARRAY_SIZE(post_list);