drivers/block/nbd.c: don't defer compile error to runtime
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
This patch was already sent on:
- 3 Sep 2005
drivers/block/nbd.c renamed from drivers/block/nbd.c.old +1 -4
@@ -643,10 +643,7 @@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,