linux-kernel-test/arch/x86/oprofile
Ingo Molnar 2c78ffeca9 x86/oprofile: Fix uninitialized variable use in debug printk
Stephen Rothwell reported this build warning:

  arch/x86/oprofile/op_model_amd.c: In function 'ibs_eilvt_valid':
  arch/x86/oprofile/op_model_amd.c:289: warning: 'offset' may be used uninitialized in this function

And correctly observed that indeed the variable is used uninitialized in
this function. The result of this bug can be a debug printk with a bogus
value.

Also fix a few more small details that made this function hard to read
and which probably contributed to the bug being introduced to begin with:

 - Use more symmetric error conditions

 - Remove the !0 obfuscation

 - Add newlines to the printk output

 - Remove bogus linebreaks in printk strings and elsewhere

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20101025115736.41d51abe.sfr@canb.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-10-25 08:46:20 +02:00
..
backtrace.c oprofile, x86: Adding backtrace dump for 32bit process in compat mode 2010-10-01 16:07:18 +02:00
init.c x86: coding style fixes to arch/x86/oprofile/init.c 2008-04-17 17:40:49 +02:00
Makefile x86/oprofile: reanaming op_model_athlon.c to op_model_amd.c 2008-07-26 11:48:14 +02:00
nmi_int.c oprofile, x86: Simplify init/exit functions 2010-10-01 17:05:47 +02:00
nmi_timer_int.c x86: coding style fixes to arch/x86/oprofile/nmi_timer_int.c 2008-04-17 17:40:50 +02:00
op_counter.h oprofile: Implement performance counter multiplexing 2009-07-20 16:33:53 +02:00
op_model_amd.c x86/oprofile: Fix uninitialized variable use in debug printk 2010-10-25 08:46:20 +02:00
op_model_p4.c oprofile/x86: return -EBUSY if counters are already reserved 2010-05-04 11:35:28 +02:00
op_model_ppro.c Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-05-18 08:19:03 -07:00
op_x86_model.h oprofile/x86: make AMD IBS hotplug capable 2010-05-06 15:11:15 +02:00