Skip to content

Commit

Permalink
[PATCH] ppc64: simplify nvram partition scanning code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and Paul Mackerras committed Jun 28, 2005
1 parent 99f95e5 commit a341ad9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/ppc64/kernel/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit a341ad9

Please sign in to comment.