[PATCH] drivers/block/nbd.c: don't defer compile error to runtime
authorAdrian Bunk <bunk@stusta.de>
Sat, 25 Mar 2006 11:07:04 +0000 (03:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 25 Mar 2006 16:22:52 +0000 (08:22 -0800)
If we can detect a problem at compile time, the compilation should fail.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/block/nbd.c

index a9bde30dadad5021e1c2a35965c825d34ac1e9a7..8bca4905d7f7357e31b8d66f53a79fc79379c874 100644 (file)
@@ -639,10 +639,7 @@ static int __init nbd_init(void)
        int err = -ENOMEM;
        int i;
 
-       if (sizeof(struct nbd_request) != 28) {
-               printk(KERN_CRIT "nbd: sizeof nbd_request needs to be 28 in order to work!\n" );
-               return -EIO;
-       }
+       BUILD_BUG_ON(sizeof(struct nbd_request) != 28);
 
        if (nbds_max > MAX_NBD) {
                printk(KERN_CRIT "nbd: cannot allocate more than %u nbds; %u requested.\n", MAX_NBD,