aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakpm@osdl.org <akpm@osdl.org>2005-05-01 11:58:44 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:58:44 -0400
commit0339ad77c4a06fa8529db17c91f790058e18b65b (patch)
treeb2287248d52745c0b9532bca13133bab7a9e4132
parentdc3ec7503e693e05c01d85b664482d0f694429ab (diff)
[PATCH] ppc64: nvram cleanups
- Fix arch/ppc64/kernel/nvram.c:342: warning: `part' might be used uninitialized in this function - Various codingstyle tweaks. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ppc64/kernel/nvram.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c
index b9069c2d1933..4e71781a4414 100644
--- a/arch/ppc64/kernel/nvram.c
+++ b/arch/ppc64/kernel/nvram.c
@@ -339,9 +339,9 @@ static int nvram_remove_os_partition(void)
339static int nvram_create_os_partition(void) 339static int nvram_create_os_partition(void)
340{ 340{
341 struct list_head * p; 341 struct list_head * p;
342 struct nvram_partition * part; 342 struct nvram_partition *part = NULL;
343 struct nvram_partition * new_part = NULL; 343 struct nvram_partition *new_part = NULL;
344 struct nvram_partition * free_part = NULL; 344 struct nvram_partition *free_part = NULL;
345 int seq_init[2] = { 0, 0 }; 345 int seq_init[2] = { 0, 0 };
346 loff_t tmp_index; 346 loff_t tmp_index;
347 long size = 0; 347 long size = 0;
@@ -364,13 +364,11 @@ static int nvram_create_os_partition(void)
364 free_part = part; 364 free_part = part;
365 } 365 }
366 } 366 }
367 if (!size) { 367 if (!size)
368 return -ENOSPC; 368 return -ENOSPC;
369 }
370 369
371 /* Create our OS partition */ 370 /* Create our OS partition */
372 new_part = (struct nvram_partition *) 371 new_part = kmalloc(sizeof(*new_part), GFP_KERNEL);
373 kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
374 if (!new_part) { 372 if (!new_part) {
375 printk(KERN_ERR "nvram_create_os_partition: kmalloc failed\n"); 373 printk(KERN_ERR "nvram_create_os_partition: kmalloc failed\n");
376 return -ENOMEM; 374 return -ENOMEM;
@@ -379,7 +377,7 @@ static int nvram_create_os_partition(void)
379 new_part->index = free_part->index; 377 new_part->index = free_part->index;
380 new_part->header.signature = NVRAM_SIG_OS; 378 new_part->header.signature = NVRAM_SIG_OS;
381 new_part->header.length = size; 379 new_part->header.length = size;
382 sprintf(new_part->header.name, "ppc64,linux"); 380 strcpy(new_part->header.name, "ppc64,linux");
383 new_part->header.checksum = nvram_checksum(&new_part->header); 381 new_part->header.checksum = nvram_checksum(&new_part->header);
384 382
385 rc = nvram_write_header(new_part); 383 rc = nvram_write_header(new_part);
@@ -394,7 +392,8 @@ static int nvram_create_os_partition(void)
394 tmp_index = new_part->index + NVRAM_HEADER_LEN; 392 tmp_index = new_part->index + NVRAM_HEADER_LEN;
395 rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index); 393 rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
396 if (rc <= 0) { 394 if (rc <= 0) {
397 printk(KERN_ERR "nvram_create_os_partition: nvram_write failed (%d)\n", rc); 395 printk(KERN_ERR "nvram_create_os_partition: nvram_write "
396 "failed (%d)\n", rc);
398 return rc; 397 return rc;
399 } 398 }
400 399