mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-09-22 12:42:50 +00:00
[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>
This commit is contained in:
parent
99f95e5286
commit
a341ad9724
1 changed files with 3 additions and 5 deletions
|
@ -338,9 +338,8 @@ static int nvram_remove_os_partition(void)
|
||||||
*/
|
*/
|
||||||
static int nvram_create_os_partition(void)
|
static int nvram_create_os_partition(void)
|
||||||
{
|
{
|
||||||
struct list_head * p;
|
struct nvram_partition *part;
|
||||||
struct nvram_partition *part = NULL;
|
struct nvram_partition *new_part;
|
||||||
struct nvram_partition *new_part = NULL;
|
|
||||||
struct nvram_partition *free_part = NULL;
|
struct nvram_partition *free_part = NULL;
|
||||||
int seq_init[2] = { 0, 0 };
|
int seq_init[2] = { 0, 0 };
|
||||||
loff_t tmp_index;
|
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
|
/* 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 */
|
If can't find one that will give us the minimum size needed */
|
||||||
list_for_each(p, &nvram_part->partition) {
|
list_for_each_entry(part, &nvram_part->partition, partition) {
|
||||||
part = list_entry(p, struct nvram_partition, partition);
|
|
||||||
if (part->header.signature != NVRAM_SIG_FREE)
|
if (part->header.signature != NVRAM_SIG_FREE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue