[2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime

From: Adrian Bunk (bunk_at_stusta.de)
Date: 09/03/05

  • Next message: iSteve: "Re: SysFS, module names and .name"
    Date:	Sat, 3 Sep 2005 00:10:59 +0200
    To: Paul.Clements@steeleye.com
    
    

    If we can detect a problem at compile time, the compilation should fail.

    Signed-off-by: Adrian Bunk <bunk@stusta.de>

    --- linux-2.6.13-mm1-full/drivers/block/nbd.c.old 2005-09-02 23:48:27.000000000 +0200
    +++ linux-2.6.13-mm1-full/drivers/block/nbd.c 2005-09-02 23:53:47.000000000 +0200
    @@ -644,8 +644,8 @@
             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;
    + extern void nbd_request_wrong_size(void);
    + nbd_request_wrong_size();
             }
     
             if (nbds_max > MAX_NBD) {

    -
    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/


  • Next message: iSteve: "Re: SysFS, module names and .name"

    Relevant Pages

    • Re: [PATCH 3/39] NLKD - early/late CPU up/down notification
      ... >> warnings) when one can already at compile time. ... >we want to not use #ifdef at all if we can ever help it. ... realized that the warning messages from the modpost build stage are very ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: The "best" value of HZ
      ... > boot time instead of at compile time? ... > Do you think it would be a desired feature the knowledge of the best value ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [CFT] 2.6.x experimental net driver updates
      ... will submit in the next batch) and we still have struct ... a few less pointer derefs and such. ... and constant can be found at compile time _if_ we pad in front of ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 4/7] dlm: configuration
      ... I fail to ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [2.6 patch] remove support for gcc < 3.2
      ... so miscompilations of a driver with an old gcc might ... > And with 4.0 being a scary regression in the compile time ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)