From: Adrian Bunk Date: Sat, 25 Mar 2006 11:07:04 +0000 (-0800) Subject: [PATCH] drivers/block/nbd.c: don't defer compile error to runtime X-Git-Tag: v2.6.17-rc1~831 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5b7b18ccdeb17dcc4a2ddbf4ce87094c7365f4b9;p=linux-2.6-omap-h63xx.git [PATCH] drivers/block/nbd.c: don't defer compile error to runtime If we can detect a problem at compile time, the compilation should fail. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index a9bde30dada..8bca4905d7f 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -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,