1. 08 4月, 2014 3 次提交
  2. 26 6月, 2012 1 次提交
    • P
      bug.h: Fix up CONFIG_BUG=n implicit function declarations. · 09682c1d
      Paul Mundt 提交于
      Commit 2603efa3 ("bug.h: Fix up powerpc build regression") corrected
      the powerpc build case and extended the __ASSEMBLY__ guards, but it also
      got caught in pre-processor hell accidentally matching the else case of
      CONFIG_BUG resulting in the BUG disabled case tripping up on
      -Werror=implicit-function-declaration.
      
      It's not possible to __ASSEMBLY__ guard the entire file as architecture
      code needs to get at the BUGFLAG_WARNING definition in the GENERIC_BUG
      case, but the rest of the CONFIG_BUG=y/n case needs to be guarded.
      
      Rather than littering endless __ASSEMBLY__ checks in each of the if/else
      cases we just move the BUGFLAG definitions up under their own
      GENERIC_BUG test and then shove everything else under one big
      __ASSEMBLY__ guard.
      
      Build tested on all of x86 CONFIG_BUG=y, CONFIG_BUG=n, powerpc (due to
      it's dependence on BUGFLAG definitions in assembly code), and sh (due to
      not bringing in linux/kernel.h to satisfy the taint flag definitions used
      by the generic bug code).
      
      Hopefully that's the end of the corner cases and I can abstain from ever
      having to touch this infernal header ever again.
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Tested-by: NFengguang Wu <wfg@linux.intel.com>
      Acked-by: NRandy Dunlap <rdunlap@xenotime.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09682c1d
  3. 19 6月, 2012 1 次提交
    • P
      bug.h: Fix up powerpc build regression. · 2603efa3
      Paul Mundt 提交于
      The asm-generic/bug.h __ASSEMBLY__ guarding is completely bogus, which
      tripped up the powerpc build when the kernel.h include was added:
      
      	In file included from include/asm-generic/bug.h:5:0,
      			 from arch/powerpc/include/asm/bug.h:127,
      			 from arch/powerpc/kernel/head_64.S:31:
      	include/linux/kernel.h:44:0: warning: "ALIGN" redefined [enabled by default]
      	include/linux/linkage.h:57:0: note: this is the location of the previous definition
      	include/linux/sysinfo.h: Assembler messages:
      	include/linux/sysinfo.h:7: Error: Unrecognized opcode: `struct'
      	include/linux/sysinfo.h:8: Error: Unrecognized opcode: `__kernel_long_t'
      
      Moving the __ASSEMBLY__ guard up and stashing the kernel.h include under
      it fixes this up, as well as covering the case the original fix was
      attempting to handle.
      Tested-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2603efa3
  4. 11 6月, 2012 1 次提交
  5. 24 3月, 2012 1 次提交
  6. 01 11月, 2011 1 次提交
  7. 27 5月, 2011 1 次提交
  8. 25 5月, 2011 1 次提交
  9. 24 5月, 2011 1 次提交
  10. 28 3月, 2011 1 次提交
    • S
      WARN_ON_SMP(): Add comment to explain ({0;}) · ccd0d44f
      Steven Rostedt 提交于
      The define to use ({0;}) for the !CONFIG_SMP case of WARN_ON_SMP()
      can be confusing. As the WARN_ON_SMP() needs to be a nop when
      CONFIG_SMP is not set, including all its parameters must not be
      evaluated, and that it must work as both a stand alone statement
      and inside an if condition, we define it to a funky ({0;}).
      
      A simple "0" will not work as it causes gcc to give the warning that
      the statement has no effect.
      
      As this strange definition has raised a few eyebrows from some
      major kernel developers, it is wise to document why we create such
      a work of art.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      ccd0d44f
  11. 25 3月, 2011 1 次提交
  12. 19 5月, 2010 1 次提交
  13. 16 12月, 2009 1 次提交
  14. 07 5月, 2009 1 次提交
  15. 16 4月, 2009 1 次提交
  16. 07 1月, 2009 1 次提交
  17. 17 12月, 2008 1 次提交
  18. 29 11月, 2008 1 次提交
  19. 21 10月, 2008 1 次提交
  20. 17 10月, 2008 1 次提交
  21. 17 9月, 2008 1 次提交
  22. 09 9月, 2008 1 次提交
  23. 26 7月, 2008 2 次提交
  24. 30 1月, 2008 2 次提交
  25. 01 8月, 2007 1 次提交
    • L
      Fix WARN_ON() on bitfield ops · 8d4fbcfb
      Linus Torvalds 提交于
      Alexey Dobriyan noticed that the new WARN_ON() semantics that were
      introduced by commit 684f9783 (to also
      return the value to be warned on) didn't compile when given a bitfield,
      because the typeof doesn't work for bitfields.
      
      So instead of the typeof trick, use an "int" variable together with a
      "!!(x)" expression, as suggested by Al Viro.
      
      To make matters more interesting, Paul Mackerras points out that that is
      sub-optimal on Power, but the old asm-coded comparison seems to be buggy
      anyway on 32-bit Power if the conditional was 64-bit, so I think there
      are more problems there.
      
      Regardless, the new WARN_ON() semantics may have been a bad idea.  But
      this at least avoids the more serious complications.
      
      Cc: Alexey Dobriyan <adobriyan@sw.ru>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Al Viro <viro@ftp.linux.org.uk>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8d4fbcfb
  26. 18 7月, 2007 1 次提交
  27. 25 5月, 2007 1 次提交
  28. 31 12月, 2006 1 次提交
    • I
      [PATCH] change WARN_ON back to "BUG: at ..." · 52e88f5d
      Ingo Molnar 提交于
      WARN_ON() ever triggering is a kernel bug.  Do not try to paper over this
      fact by suggesting to the user that this is 'only' a warning, as the
      following recent commit does:
      
        commit 30e25b71
        Author: Jeremy Fitzhardinge <jeremy@goop.org>
        Date:   Fri Dec 8 02:36:24 2006 -0800
      
          [PATCH] Fix generic WARN_ON message
      
          A warning is a warning, not a BUG.
      
      ( it might make sense to rename BUG() to CRASH() and BUG_ON() to
        CRASH_ON(), but that does not change the fact that WARN_ON()
        signals a kernel bug. )
      
      i and others objected to this change during lkml review:
      
        http://marc.theaimsgroup.com/?l=linux-kernel&m=116115160710533&w=2
      
      still the change slipped upstream - grumble :)
      
      Also, use the standard "BUG: " format to make it easier to grep logs and
      to make it easier to google for kernel bugs.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      52e88f5d
  29. 09 12月, 2006 2 次提交
    • J
      [PATCH] Fix generic WARN_ON message · 30e25b71
      Jeremy Fitzhardinge 提交于
      A warning is a warning, not a BUG.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      30e25b71
    • J
      [PATCH] Generic BUG implementation · 7664c5a1
      Jeremy Fitzhardinge 提交于
      This patch adds common handling for kernel BUGs, for use by architectures as
      they wish.  The code is derived from arch/powerpc.
      
      The advantages of having common BUG handling are:
       - consistent BUG reporting across architectures
       - shared implementation of out-of-line file/line data
       - implement CONFIG_DEBUG_BUGVERBOSE consistently
      
      This means that in inline impact of BUG is just the illegal instruction
      itself, which is an improvement for i386 and x86-64.
      
      A BUG is represented in the instruction stream as an illegal instruction,
      which has file/line information associated with it.  This extra information is
      stored in the __bug_table section in the ELF file.
      
      When the kernel gets an illegal instruction, it first confirms it might
      possibly be from a BUG (ie, in kernel mode, the right illegal instruction).
      It then calls report_bug().  This searches __bug_table for a matching
      instruction pointer, and if found, prints the corresponding file/line
      information.  If report_bug() determines that it wasn't a BUG which caused the
      trap, it returns BUG_TRAP_TYPE_NONE.
      
      Some architectures (powerpc) implement WARN using the same mechanism; if the
      illegal instruction was the result of a WARN, then report_bug(Q) returns
      CONFIG_DEBUG_BUGVERBOSE; otherwise it returns BUG_TRAP_TYPE_BUG.
      
      lib/bug.c keeps a list of loaded modules which can be searched for __bug_table
      entries.  The architecture must call
      module_bug_finalize()/module_bug_cleanup() from its corresponding
      module_finalize/cleanup functions.
      
      Unsetting CONFIG_DEBUG_BUGVERBOSE will reduce the kernel size by some amount.
      At the very least, filename and line information will not be recorded for each
      but, but architectures may decide to store no extra information per BUG at
      all.
      
      Unfortunately, gcc doesn't have a general way to mark an asm() as noreturn, so
      architectures will generally have to include an infinite loop (or similar) in
      the BUG code, so that gcc knows execution won't continue beyond that point.
      gcc does have a __builtin_trap() operator which may be useful to achieve the
      same effect, unfortunately it cannot be used to actually implement the BUG
      itself, because there's no way to get the instruction's address for use in
      generating the __bug_table entry.
      
      [randy.dunlap@oracle.com: Handle BUG=n, GENERIC_BUG=n to prevent build errors]
      [bunk@stusta.de: include/linux/bug.h must always #include <linux/module.h]
      Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Hugh Dickens <hugh@veritas.com>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7664c5a1
  30. 21 10月, 2006 1 次提交
    • R
      [PATCH] Fix warnings for WARN_ON if CONFIG_BUG is disabled · 8c7c7c9b
      Ralf Baechle 提交于
      In most cases the return value of WARN_ON() is ignored.  If the generic
      definition for the !CONFIG_BUG case is used this will result in a warning:
      
        CC      kernel/sched.o
      In file included from include/linux/bio.h:25,
                       from include/linux/blkdev.h:14,
                       from kernel/sched.c:39:
      include/linux/ioprio.h: In function ‘task_ioprio’:
      include/linux/ioprio.h:50: warning: statement with no effect
      kernel/sched.c: In function ‘context_switch’:
      kernel/sched.c:1834: warning: statement with no effect
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      8c7c7c9b
  31. 06 10月, 2006 1 次提交
    • A
      [PATCH] Fix WARN_ON / WARN_ON_ONCE regression · d69a8922
      Andrew Morton 提交于
      Tim and Ananiev report that the recent WARN_ON_ONCE changes cause increased
      cache misses with the tbench workload.  Apparently due to the access to the
      newly-added static variable.
      
      Rearrange the code so that we don't touch that variable unless the warning is
      going to trigger.
      
      Also rework the logic so that the static variable starts out at zero, so we
      can move it into bss.
      
      It would seem logical to mark the static variable as __read_mostly too.  But
      it would be wrong, because that would put it back into the vmlinux image, and
      the kernel will never read from this variable in normal operation anyway.
      Unless the compiler or hardware go and do some prefetching on us?
      
      For some reason this patch shrinks softirq.o text by 40 bytes.
      
      Cc: Tim Chen <tim.c.chen@intel.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "Ananiev, Leonid I" <leonid.i.ananiev@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d69a8922
  32. 30 9月, 2006 1 次提交
  33. 28 6月, 2006 1 次提交
  34. 26 6月, 2006 1 次提交
  35. 26 4月, 2006 1 次提交