drivers/block/nbd.c: don't defer compile error to runtime (fwd)
Subsystems (2)
PATCH 1/1 drivers/block/nbd.c: don't defer compile error to runtime (fwd)
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:
- 20 Feb 2006
- 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,
Quoted 3 lines
If we can detect a problem at compile time, the compilation should fail.
Hi,
do the same with fs/minix/*, it also checks sizeof() to 32/64 at runtime.
Jan Engelhardt