Skip to content

Commit

Permalink
powerpc/nvram: Ensure that the partition header/block size is right
Browse files Browse the repository at this point in the history
Use BUILD_BUG_ON to ensure the structure representing a partition
header have the right size.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Benjamin Herrenschmidt committed Nov 30, 2010
1 parent 3667330 commit 578914c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/nvram_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ static int __init nvram_init(void)
int error;
int rc;

BUILD_BUG_ON(NVRAM_BLOCK_LEN != 16);

if (ppc_md.nvram_size == NULL || ppc_md.nvram_size() <= 0)
return -ENODEV;

Expand Down

0 comments on commit 578914c

Please sign in to comment.