Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Adrian Bunk and committed by
Linus Torvalds
5b7b18cc 1aef821a

+1 -4
+1 -4
drivers/block/nbd.c
··· 639 639 int err = -ENOMEM; 640 640 int i; 641 641 642 - if (sizeof(struct nbd_request) != 28) { 643 - printk(KERN_CRIT "nbd: sizeof nbd_request needs to be 28 in order to work!\n" ); 644 - return -EIO; 645 - } 642 + BUILD_BUG_ON(sizeof(struct nbd_request) != 28); 646 643 647 644 if (nbds_max > MAX_NBD) { 648 645 printk(KERN_CRIT "nbd: cannot allocate more than %u nbds; %u requested.\n", MAX_NBD,