Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 653
b: refs/heads/master
c: 0339ad7
h: refs/heads/master
i:
  651: 06910bc
v: v3
  • Loading branch information
akpm@osdl.org authored and Linus Torvalds committed May 1, 2005
1 parent 744bb56 commit 813cb1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc3ec7503e693e05c01d85b664482d0f694429ab
refs/heads/master: 0339ad77c4a06fa8529db17c91f790058e18b65b
17 changes: 8 additions & 9 deletions trunk/arch/ppc64/kernel/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ static int nvram_remove_os_partition(void)
static int nvram_create_os_partition(void)
{
struct list_head * p;
struct nvram_partition * part;
struct nvram_partition * new_part = NULL;
struct nvram_partition * free_part = NULL;
struct nvram_partition *part = NULL;
struct nvram_partition *new_part = NULL;
struct nvram_partition *free_part = NULL;
int seq_init[2] = { 0, 0 };
loff_t tmp_index;
long size = 0;
Expand All @@ -364,13 +364,11 @@ static int nvram_create_os_partition(void)
free_part = part;
}
}
if (!size) {
if (!size)
return -ENOSPC;
}

/* Create our OS partition */
new_part = (struct nvram_partition *)
kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
new_part = kmalloc(sizeof(*new_part), GFP_KERNEL);
if (!new_part) {
printk(KERN_ERR "nvram_create_os_partition: kmalloc failed\n");
return -ENOMEM;
Expand All @@ -379,7 +377,7 @@ static int nvram_create_os_partition(void)
new_part->index = free_part->index;
new_part->header.signature = NVRAM_SIG_OS;
new_part->header.length = size;
sprintf(new_part->header.name, "ppc64,linux");
strcpy(new_part->header.name, "ppc64,linux");
new_part->header.checksum = nvram_checksum(&new_part->header);

rc = nvram_write_header(new_part);
Expand All @@ -394,7 +392,8 @@ static int nvram_create_os_partition(void)
tmp_index = new_part->index + NVRAM_HEADER_LEN;
rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
if (rc <= 0) {
printk(KERN_ERR "nvram_create_os_partition: nvram_write failed (%d)\n", rc);
printk(KERN_ERR "nvram_create_os_partition: nvram_write "
"failed (%d)\n", rc);
return rc;
}

Expand Down

0 comments on commit 813cb1e

Please sign in to comment.