[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1296130356-29896-1-git-send-email-bosong.ly@taobao.com>
Date: Thu, 27 Jan 2011 20:12:29 +0800
From: Coly Li <bosong.ly@...bao.com>
To: linux-kernel@...r.kernel.org
Cc: Coly Li <bosong.ly@...bao.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg KH <gregkh@...e.de>
Subject: [PATCH 0/6] use BUG_ON correctly, v2
Most of BUG_ON() implementations use unlikely() internally for better
branch prediction results. The following method to use BUG_ON() with
an explicit unlikely() doesn't make things better and is unwelcome:
BUG_ON(unlikely(condition));
Source code should use BUG_ON() just with condition code.
For arch dependent BUG_ON() implementations, they should use unlikely()
internally if they are able to.
This patch set does two things,
1) Remove all explicit unlikey() where kernel code uses BUG_ON().
2) Fix arch dependent BUG_ON() implementations if they don't use
unlikely() internally.
The difference between v2 and v1 patch set are,
1) Remove the fix of mm/nommu.c, because it's in mm-tree already.
2) Add unlikely() inside the BUG_ON() implementations of MIPS and PPC.
Signed-off-by: Coly Li <bosong.ly@...bao.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Greg KH <gregkh@...e.de>
---
arch/mips/include/asm/bug.h | 2 +-
arch/powerpc/include/asm/bug.h | 4 +++-
drivers/dma/iop-adma.c | 6 +++---
drivers/dma/mv_xor.c | 6 +++---
drivers/dma/ppc4xx/adma.c | 8 ++++----
drivers/scsi/scsi_lib.c | 4 ++--
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 14 +++++++-------
7 files changed, 23 insertions(+), 21 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists