Browse Source

powerpc/nvram: Ensure that the partition header/block size is right

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>
Benjamin Herrenschmidt 15 years ago
parent
commit
578914cffc
1 changed files with 2 additions and 0 deletions
  1. 2 0
      arch/powerpc/kernel/nvram_64.c

+ 2 - 0
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;