[2.6 patch][0/3] BUG -> BUG_ON conversions

From: Adrian Bunk (bunk_at_fs.tum.de)
Date: 08/28/04

  • Next message: Adrian Bunk: "[2.6 patch][1/3] ipc/ BUG -> BUG_ON conversions"
    Date:	Sat, 28 Aug 2004 17:11:37 +0200
    To: Andrew Morton <akpm@osdl.org>
    
    

    Hi Andrew,

    in the following mails are the first [1] three patches that convert

      if(foo)
            BUG():

    to

      BUG_ON(foo);

    This makes the code slightly better readable and it might result in
    slightly better code with recent gcc versions due to the "unlikely" in
    the definition of BUG_ON (it might not be a measurable difference, but
    it comes for free).

    Obviosly, in constructs like

      if (foo) {
            printk(KERN_ERR "some error");
            BUG();
      }

    or

      switch (foo) {
      case A:
            ...
            break;
      case B:
            ...
            break;
      default:
            BUG();
      }

    BUG() can't be replaced by BUG_ON(), and it's therefore unchanged.
      

    cu
    Adrian

    [1] I plan to send more such patches.

    -- 
           "Is there not promise of rain?" Ling Tan asked suddenly out
            of the darkness. There had been need of rain for many days.
           "Only a promise," Lao Er said.
                                           Pearl S. Buck - Dragon Seed
    -
    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: Adrian Bunk: "[2.6 patch][1/3] ipc/ BUG -> BUG_ON conversions"

    Relevant Pages

    • Re: 2.6.13-mm1
      ... > It spat rejects and when I looked at the putative removal date I just ... I can use this to push you harder to forward some patches of me to Linus ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.9-rc3-mm1 build failure
      ... >> produced a build here that actually gets rid of the build error. ... I fixed it up with the below two patches. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [-mm patch] SCSI_QLA2ABC options must select FW_LOADER
      ... > I send a patch for this yesterday that lets SCSI_QLA2XXX select ... stay as it is (with the fixes from my patches) doesn't matter much - ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [linux-dvb-maintainer] [2.6 patch] add missing selects to DVB_BUDGET_AV
      ... > I also added this to linuxtv.org CVS. ... If I were a -stable maintainer, I'd include both patches after they were ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.4 patch] netfilter Configure.help cleanup
      ... > I will submit the RECENT entry to davem with my next set of patches. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)