All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] use BUG_ON correctly, v2
@ 2011-01-27 12:12 Coly Li
  2011-01-27 12:12 ` [PATCH 1/7] MIPS: add unlikely() to BUG_ON() Coly Li
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Coly Li @ 2011-01-27 12:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Coly Li, Andrew Morton, Greg KH

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@taobao.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg KH <gregkh@suse.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(-)

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2011-01-28 10:36 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 12:12 [PATCH 0/6] use BUG_ON correctly, v2 Coly Li
2011-01-27 12:12 ` [PATCH 1/7] MIPS: add unlikely() to BUG_ON() Coly Li
2011-01-27 17:50   ` David Daney
2011-01-28 10:41     ` Coly Li
2011-01-27 12:12 ` [PATCH 2/7] PowerPC: " Coly Li
2011-01-27 17:57   ` David Daney
2011-01-27 17:57     ` David Daney
2011-01-27 20:04     ` Scott Wood
2011-01-27 20:04       ` Scott Wood
2011-01-27 20:32       ` David Daney
2011-01-27 20:32         ` David Daney
2011-01-28  9:05     ` David Laight
2011-01-28  9:05       ` David Laight
     [not found]     ` <AE90C24D6B3A694183C094C60CF0A2F6D8AC2D__37237.0892241181$1296205746$gmane$org@saturn3.aculab.com>
2011-01-28 10:14       ` Andreas Schwab
2011-01-28 10:14         ` Andreas Schwab
2011-01-28 11:02         ` Coly Li
2011-01-28 11:02           ` Coly Li
2011-01-27 12:12 ` [PATCH 3/7] dma: use BUG_ON correctly in iop-adma.c Coly Li
2011-01-27 12:12 ` [PATCH 4/7] dma: use BUG_ON correctly in mv_xor.c Coly Li
2011-01-27 12:12 ` [PATCH 5/7] dma: use BUG_ON correctly in ppc4xx/adam.c Coly Li
2011-01-27 12:12 ` [PATCH 6/7] wl_cfg80211.c: use BUG_ON correctly Coly Li
2011-01-27 12:12 ` [PATCH 7/7] scsi_lib.c: " Coly Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.