public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FRV: Fix no-hardware-breakpoint case
@ 2009-12-14 14:03 David Howells
  2009-12-14 14:06 ` Frederic Weisbecker
  2009-12-15  7:24 ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2009-12-14 14:03 UTC (permalink / raw)
  To: torvalds, akpm, fweisbec; +Cc: dhowells, mingo, linux-kernel

If there is no hardware breakpoint support, modify_user_hw_breakpoint() tries
to return a NULL pointer through as an 'int' return value:

In file included from kernel/exit.c:53:
include/linux/hw_breakpoint.h: In function 'modify_user_hw_breakpoint':
include/linux/hw_breakpoint.h:96: warning: return makes integer from pointer without a cast

Return 0 instead.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/hw_breakpoint.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 69f07a9..e268388 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -93,7 +93,7 @@ register_user_hw_breakpoint(struct perf_event_attr *attr,
 			    struct task_struct *tsk)	{ return NULL; }
 static inline int
 modify_user_hw_breakpoint(struct perf_event *bp,
-			  struct perf_event_attr *attr)	{ return NULL; }
+			  struct perf_event_attr *attr)	{ return 0; }
 static inline struct perf_event *
 register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
 				perf_overflow_handler_t	 triggered,


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

* Re: [PATCH] FRV: Fix no-hardware-breakpoint case
  2009-12-14 14:03 [PATCH] FRV: Fix no-hardware-breakpoint case David Howells
@ 2009-12-14 14:06 ` Frederic Weisbecker
  2009-12-15  7:24 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2009-12-14 14:06 UTC (permalink / raw)
  To: David Howells; +Cc: torvalds, akpm, mingo, linux-kernel

On Mon, Dec 14, 2009 at 02:03:27PM +0000, David Howells wrote:
> If there is no hardware breakpoint support, modify_user_hw_breakpoint() tries
> to return a NULL pointer through as an 'int' return value:
> 
> In file included from kernel/exit.c:53:
> include/linux/hw_breakpoint.h: In function 'modify_user_hw_breakpoint':
> include/linux/hw_breakpoint.h:96: warning: return makes integer from pointer without a cast
> 
> Return 0 instead.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>


Thanks, we have this fixed in tip:/perf/urgent already. It should
reach upstream soon.


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

* Re: [PATCH] FRV: Fix no-hardware-breakpoint case
  2009-12-14 14:03 [PATCH] FRV: Fix no-hardware-breakpoint case David Howells
  2009-12-14 14:06 ` Frederic Weisbecker
@ 2009-12-15  7:24 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2009-12-15  7:24 UTC (permalink / raw)
  To: David Howells; +Cc: torvalds, akpm, fweisbec, linux-kernel


* David Howells <dhowells@redhat.com> wrote:

> If there is no hardware breakpoint support, modify_user_hw_breakpoint() tries
> to return a NULL pointer through as an 'int' return value:
> 
> In file included from kernel/exit.c:53:
> include/linux/hw_breakpoint.h: In function 'modify_user_hw_breakpoint':
> include/linux/hw_breakpoint.h:96: warning: return makes integer from pointer without a cast
> 
> Return 0 instead.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
> 
>  include/linux/hw_breakpoint.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> 
> diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
> index 69f07a9..e268388 100644
> --- a/include/linux/hw_breakpoint.h
> +++ b/include/linux/hw_breakpoint.h
> @@ -93,7 +93,7 @@ register_user_hw_breakpoint(struct perf_event_attr *attr,
>  			    struct task_struct *tsk)	{ return NULL; }
>  static inline int
>  modify_user_hw_breakpoint(struct perf_event *bp,
> -			  struct perf_event_attr *attr)	{ return NULL; }
> +			  struct perf_event_attr *attr)	{ return 0; }

Note, this patch is wrong as it only papers over the warning without 
understanding the underlying bug: the right fix is to return an error code.

The latest perf update has the right fix - AFAICS Linus did the conflict 
resolution correctly so upstream should be fine.

	Ingo

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

end of thread, other threads:[~2009-12-15  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14 14:03 [PATCH] FRV: Fix no-hardware-breakpoint case David Howells
2009-12-14 14:06 ` Frederic Weisbecker
2009-12-15  7:24 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox