Skip to content

Commit

Permalink
[PATCH] drivers/block/nbd.c: don't defer compile error to runtime
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Mar 25, 2006
1 parent 1aef821 commit 5b7b18c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5b7b18c

Please sign in to comment.