diff options
author | Arnd Bergmann <arnd@arndb.de> | 2005-06-28 20:33:49 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-06-28 20:33:49 +1000 |
commit | a341ad97245d01c923995cfe7deacd0c8aee6e16 (patch) | |
tree | 5685b51e3feafaf2a72f621a9c00c881199e6b3d /arch/ppc64 | |
parent | 99f95e5286df2f69edab8a04c7080d986ee4233b (diff) | |
download | kernel_samsung_smdk4412-a341ad97245d01c923995cfe7deacd0c8aee6e16.zip kernel_samsung_smdk4412-a341ad97245d01c923995cfe7deacd0c8aee6e16.tar.gz kernel_samsung_smdk4412-a341ad97245d01c923995cfe7deacd0c8aee6e16.tar.bz2 |
[PATCH] ppc64: simplify nvram partition scanning code
Convert nvram_create_os_partition to use list_for_each_entry
instead of list_for_each, as this reduces the code size by
two lines.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/nvram.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c index 4e71781..4fb1a9f 100644 --- a/arch/ppc64/kernel/nvram.c +++ b/arch/ppc64/kernel/nvram.c @@ -338,9 +338,8 @@ static int nvram_remove_os_partition(void) */ static int nvram_create_os_partition(void) { - struct list_head * p; - struct nvram_partition *part = NULL; - struct nvram_partition *new_part = NULL; + struct nvram_partition *part; + struct nvram_partition *new_part; struct nvram_partition *free_part = NULL; int seq_init[2] = { 0, 0 }; loff_t tmp_index; @@ -349,8 +348,7 @@ static int nvram_create_os_partition(void) /* Find a free partition that will give us the maximum needed size If can't find one that will give us the minimum size needed */ - list_for_each(p, &nvram_part->partition) { - part = list_entry(p, struct nvram_partition, partition); + list_for_each_entry(part, &nvram_part->partition, partition) { if (part->header.signature != NVRAM_SIG_FREE) continue; |