linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

* Re: [PATCH] kprobes: Fix compiler warning
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Ananth N Mavinakayanahalli @ 2007-01-30  5:55 UTC (permalink / raw)
  To: Kumar Gala
  Cc: linux-kernel, Andrew Morton, prasanna, anil.s.keshavamurthy,
	davem, Paul Mackerras, masami.hiramatsu.pt

On Mon, Jan 29, 2007 at 11:43:33PM -0600, Kumar Gala wrote:
> 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.

Kumar,

Masami fixed this last week:

http://marc.theaimsgroup.com/?l=linux-kernel&m=116968723823366&w=2

Patch currently in -mm.

Thanks,
Ananth

> 
> 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	[flat|nested] 8+ messages in thread

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


On Jan 29, 2007, at 11:55 PM, Ananth N Mavinakayanahalli wrote:

> On Mon, Jan 29, 2007 at 11:43:33PM -0600, Kumar Gala wrote:
>> 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.
>
> Kumar,
>
> Masami fixed this last week:
>
> http://marc.theaimsgroup.com/?l=linux-kernel&m=116968723823366&w=2
>
> Patch currently in -mm.
>
> Thanks,
> Ananth

Cool, Masami's patch looks far more complete.

- k


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

* Re: [PATCH] kprobes: Fix compiler warning
  2007-01-30  7:05   ` Kumar Gala
@ 2007-01-30  7:12     ` Kumar Gala
  2007-01-30  7:41       ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Kumar Gala @ 2007-01-30  7:12 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ananth, Linux Kernel list, prasanna, anil.s.keshavamurthy,
	David S. Miller, Paul Mackerras, masami.hiramatsu.pt


On Jan 30, 2007, at 1:05 AM, Kumar Gala wrote:

>
> On Jan 29, 2007, at 11:55 PM, Ananth N Mavinakayanahalli wrote:
>
>> On Mon, Jan 29, 2007 at 11:43:33PM -0600, Kumar Gala wrote:
>>> 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.
>>
>> Kumar,
>>
>> Masami fixed this last week:
>>
>> http://marc.theaimsgroup.com/?l=linux-kernel&m=116968723823366&w=2
>>
>> Patch currently in -mm.
>>
>> Thanks,
>> Ananth
>
> Cool, Masami's patch looks far more complete.

Andrew,

What are your thoughts on forward Masami patch to Linus for 2.6.20  
since it fixes a real bug on PPC?

- k

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

* Re: [PATCH] kprobes: Fix compiler warning
  2007-01-30  7:12     ` Kumar Gala
@ 2007-01-30  7:41       ` Andrew Morton
  2007-01-31  0:04         ` Kumar Gala
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2007-01-30  7:41 UTC (permalink / raw)
  To: Kumar Gala
  Cc: ananth, Linux Kernel list, prasanna, anil.s.keshavamurthy,
	David S. Miller, Paul Mackerras, masami.hiramatsu.pt

On Tue, 30 Jan 2007 01:12:17 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:

> What are your thoughts on forward Masami patch to Linus for 2.6.20  
> since it fixes a real bug on PPC?

I bumped it up into the for-2.6.20 slot.

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

* Re: [PATCH] kprobes: Fix compiler warning
  2007-01-30  7:41       ` Andrew Morton
@ 2007-01-31  0:04         ` Kumar Gala
  0 siblings, 0 replies; 8+ messages in thread
From: Kumar Gala @ 2007-01-31  0:04 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ananth, Linux Kernel list, prasanna, anil.s.keshavamurthy,
	David S. Miller, Paul Mackerras, masami.hiramatsu.pt


On Jan 30, 2007, at 1:41 AM, Andrew Morton wrote:

> On Tue, 30 Jan 2007 01:12:17 -0600
> Kumar Gala <galak@kernel.crashing.org> wrote:
>
>> What are your thoughts on forward Masami patch to Linus for 2.6.20
>> since it fixes a real bug on PPC?
>
> I bumped it up into the for-2.6.20 slot.

thanks.

- k


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

* [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

* Re: [PATCH] kprobes: fix compiler warning
  2013-07-01 14:33 [PATCH] kprobes: fix compiler warning Dong Fang
@ 2013-07-01 14:46 ` Dong Fang
  0 siblings, 0 replies; 8+ messages in thread
From: Dong Fang @ 2013-07-01 14:46 UTC (permalink / raw)
  To: Dong Fang; +Cc: viro, nyc, fweisbec, dhowells, mchehab, linux-kernel

On 07/01/2013 10:33 AM, Dong Fang wrote:
> 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 */
>
this patch seems have some problem, i will send a new patch later, thx

^ permalink raw reply	[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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).