diff options
author | Stoyan Gaydarov <sgayda2@uiuc.edu> | 2009-07-21 13:02:31 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-19 20:29:23 -0400 |
commit | a888ad451a96881a7e40f40f717d05f1f3b26ad4 (patch) | |
tree | 5d4dbc7dccdf890f3c072b7aacb4d039a1c8853a | |
parent | bbdc16f58ed84523e8991f103dceb586e9053e04 (diff) |
powerpc: ARRAY_SIZE changes in pasemi and powermac code
These changes were a direct result of using a semantic patch
More information can be found at http://www.emn.fr/x-info/coccinelle/
Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/pasemi/idle.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c index 43911d8b0206..75b296bc51af 100644 --- a/arch/powerpc/platforms/pasemi/idle.c +++ b/arch/powerpc/platforms/pasemi/idle.c | |||
@@ -90,7 +90,7 @@ machine_late_initcall(pasemi, pasemi_idle_init); | |||
90 | static int __init idle_param(char *p) | 90 | static int __init idle_param(char *p) |
91 | { | 91 | { |
92 | int i; | 92 | int i; |
93 | for (i = 0; i < sizeof(modes)/sizeof(struct sleep_mode); i++) { | 93 | for (i = 0; i < ARRAY_SIZE(modes); i++) { |
94 | if (!strcmp(modes[i].name, p)) { | 94 | if (!strcmp(modes[i].name, p)) { |
95 | current_mode = i; | 95 | current_mode = i; |
96 | break; | 96 | break; |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index e6c0040ee797..095de3227d83 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2419,13 +2419,13 @@ static int __init probe_motherboard(void) | |||
2419 | dt = of_find_node_by_name(NULL, "device-tree"); | 2419 | dt = of_find_node_by_name(NULL, "device-tree"); |
2420 | if (dt != NULL) | 2420 | if (dt != NULL) |
2421 | model = of_get_property(dt, "model", NULL); | 2421 | model = of_get_property(dt, "model", NULL); |
2422 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2422 | for(i=0; model && i<ARRAY_SIZE(pmac_mb_defs); i++) { |
2423 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { | 2423 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { |
2424 | pmac_mb = pmac_mb_defs[i]; | 2424 | pmac_mb = pmac_mb_defs[i]; |
2425 | goto found; | 2425 | goto found; |
2426 | } | 2426 | } |
2427 | } | 2427 | } |
2428 | for(i=0; i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2428 | for(i=0; i<ARRAY_SIZE(pmac_mb_defs); i++) { |
2429 | if (machine_is_compatible(pmac_mb_defs[i].model_string)) { | 2429 | if (machine_is_compatible(pmac_mb_defs[i].model_string)) { |
2430 | pmac_mb = pmac_mb_defs[i]; | 2430 | pmac_mb = pmac_mb_defs[i]; |
2431 | goto found; | 2431 | goto found; |