All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kprobes: fix compiler warning
@ 2013-07-01 14:33 Dong Fang
  2013-07-01 14:46 ` Dong Fang
  0 siblings, 1 reply; 8+ messages in thread
From: Dong Fang @ 2013-07-01 14:33 UTC (permalink / raw)
  To: viro; +Cc: nyc, fweisbec, dhowells, mchehab, linux-kernel, Dong Fang

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

Fix the following compiler warning of uninitialized variable

kernel/kprobes.c: In function ‘register_kprobe’:
kernel/kprobes.c:1493: warning: ‘probed_mod’ may be used uninitialized in this function

Signed-off-by: Dong Fang <yp.fangdong@gmail.com>
---
 kernel/kprobes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index bddf3b2..7a5b2b1 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1490,7 +1490,7 @@ int __kprobes register_kprobe(struct kprobe *p)
 {
 	int ret;
 	struct kprobe *old_p;
-	struct module *probed_mod;
+	struct module *probed_mod = NULL;
 	kprobe_opcode_t *addr;
 
 	/* Adjust probe address from symbol */
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] kprobes: Fix compiler warning
@ 2007-01-30  5:43 Kumar Gala
  2007-01-30  5:55 ` Ananth N Mavinakayanahalli
  0 siblings, 1 reply; 8+ messages in thread
From: Kumar Gala @ 2007-01-30  5:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, prasanna, ananth, anil.s.keshavamurthy, davem,
	Paul Mackerras

On ppc the compiler gripes about:

kernel/kprobes.c: In function 'collect_garbage_slots':
kernel/kprobes.c:215: warning: comparison is always false due to limited range of data type

The compiler ends up optimizing away the test since char's are unsigned on ppc.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 1ee2dc5300b1c454f92eeea82da300f72db1b26f
tree c73cdacb43e154292708d967e11b1cbf7ab4904f
parent c0d4d573feed199b16094c072e7cb07afb01c598
author Kumar Gala <galak@kernel.crashing.org> Mon, 29 Jan 2007 23:38:11 -0600
committer Kumar Gala <galak@kernel.crashing.org> Mon, 29 Jan 2007 23:38:11 -0600

  kernel/kprobes.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 17ec4af..514276f 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -212,7 +212,7 @@ static int __kprobes collect_garbage_slots(void)
  			continue;
  		kip->ngarbage = 0;	/* we will collect all garbages */
  		for (i = 0; i < INSNS_PER_PAGE; i++) {
-			if (kip->slot_used[i] == -1 &&
+			if (kip->slot_used[i] == (char)-1 &&
  			    collect_one_slot(kip, i))
  				break;
  		}

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

end of thread, other threads:[~2013-07-01 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-01 14:33 [PATCH] kprobes: fix compiler warning Dong Fang
2013-07-01 14:46 ` Dong Fang
  -- strict thread matches above, loose matches on Subject: below --
2007-01-30  5:43 [PATCH] kprobes: Fix " Kumar Gala
2007-01-30  5:55 ` Ananth N Mavinakayanahalli
2007-01-30  7:05   ` Kumar Gala
2007-01-30  7:12     ` Kumar Gala
2007-01-30  7:41       ` Andrew Morton
2007-01-31  0:04         ` Kumar Gala

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.