move ARRAY_SIZE macro to types.h
The ARRAY_SIZE macro was defined in several target files, so move it to types.h. This patch also removes two other identical macros: DIM (from jtag.h) and asizeof (from arm11.h).
This commit is contained in:
@@ -363,7 +363,7 @@ const char *tap_state_name(tap_state_t state)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < DIM(tap_name_mapping); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(tap_name_mapping); i++) {
|
||||
if (tap_name_mapping[i].symbol == state)
|
||||
return tap_name_mapping[i].name;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ tap_state_t tap_state_by_name(const char *name)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < DIM(tap_name_mapping); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(tap_name_mapping); i++) {
|
||||
/* be nice to the human */
|
||||
if (strcasecmp(name, tap_name_mapping[i].name) == 0)
|
||||
return tap_name_mapping[i].symbol;
|
||||
|
||||
Reference in New Issue
Block a user