Re: [2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime
From: Adam Kropelin (akropel1_at_rochester.rr.com)
Date: 09/03/05
- Previous message: Francois Romieu: "sis190/sis191 driver"
- In reply to: Adrian Bunk: "[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime"
- Next in thread: Adrian Bunk: "[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime"
- Reply: Adrian Bunk: "[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 2 Sep 2005 19:20:47 -0400 To: Adrian Bunk <bunk@stusta.de>
Adrian Bunk wrote:
> If we can detect a problem at compile time, the compilation should
> fail.
[...]
> if (sizeof(struct nbd_request) != 28) {
> - printk(KERN_CRIT "nbd: sizeof nbd_request needs to be 28 in order to work!\n" );
> - return -EIO;
> + extern void nbd_request_wrong_size(void);
> + nbd_request_wrong_size();
BUILD_BUG_ON(sizeof(struct nbd_request) != 28);
...perhaps?
--Adam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Francois Romieu: "sis190/sis191 driver"
- In reply to: Adrian Bunk: "[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime"
- Next in thread: Adrian Bunk: "[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime"
- Reply: Adrian Bunk: "[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|