diff mbox

[04/13] powerpc/nvram: Ensure that the partition header/block size is right

Message ID 1291096063-14386-4-git-send-email-benh@kernel.crashing.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Benjamin Herrenschmidt Nov. 30, 2010, 5:47 a.m. UTC
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

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>
---
 arch/powerpc/kernel/nvram_64.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index a5a5587..f753882 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -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;