提交 5b7b18cc 编写于 作者: A Adrian Bunk 提交者: Linus Torvalds

[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: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1aef821a
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册