* [PATCH] MIPS: ftrace: Remove pointer comparison to 0 in prepare_ftrace_return
@ 2018-01-17 11:31 Mathieu Malaterre
2018-01-17 21:13 ` James Hogan
2018-02-01 12:03 ` James Hogan
0 siblings, 2 replies; 3+ messages in thread
From: Mathieu Malaterre @ 2018-01-17 11:31 UTC (permalink / raw)
To: Ralf Baechle
Cc: Mathieu Malaterre, Steven Rostedt, Ingo Molnar, linux-mips, linux-kernel
Replace pointer comparison to 0 with NULL in prepare_ftrace_return
to improve code readability. Identified with coccinelle script
'badzero.cocci'.
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
arch/mips/kernel/ftrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 99285be0e088..7f3dfdbc3657 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -361,7 +361,7 @@ void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra,
* If fails when getting the stack address of the non-leaf function's
* ra, stop function graph tracer and return
*/
- if (parent_ra_addr == 0)
+ if (parent_ra_addr == NULL)
goto out;
#endif
/* *parent_ra_addr = return_hooker; */
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: ftrace: Remove pointer comparison to 0 in prepare_ftrace_return
2018-01-17 11:31 [PATCH] MIPS: ftrace: Remove pointer comparison to 0 in prepare_ftrace_return Mathieu Malaterre
@ 2018-01-17 21:13 ` James Hogan
2018-02-01 12:03 ` James Hogan
1 sibling, 0 replies; 3+ messages in thread
From: James Hogan @ 2018-01-17 21:13 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Ralf Baechle, Steven Rostedt, Ingo Molnar, linux-mips, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
On Wed, Jan 17, 2018 at 12:31:57PM +0100, Mathieu Malaterre wrote:
> Replace pointer comparison to 0 with NULL in prepare_ftrace_return
> to improve code readability. Identified with coccinelle script
> 'badzero.cocci'.
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
Reviewed-by: James Hogan <jhogan@kernel.org>
Cheers
James
> ---
> arch/mips/kernel/ftrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
> index 99285be0e088..7f3dfdbc3657 100644
> --- a/arch/mips/kernel/ftrace.c
> +++ b/arch/mips/kernel/ftrace.c
> @@ -361,7 +361,7 @@ void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra,
> * If fails when getting the stack address of the non-leaf function's
> * ra, stop function graph tracer and return
> */
> - if (parent_ra_addr == 0)
> + if (parent_ra_addr == NULL)
> goto out;
> #endif
> /* *parent_ra_addr = return_hooker; */
> --
> 2.11.0
>
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: ftrace: Remove pointer comparison to 0 in prepare_ftrace_return
2018-01-17 11:31 [PATCH] MIPS: ftrace: Remove pointer comparison to 0 in prepare_ftrace_return Mathieu Malaterre
2018-01-17 21:13 ` James Hogan
@ 2018-02-01 12:03 ` James Hogan
1 sibling, 0 replies; 3+ messages in thread
From: James Hogan @ 2018-02-01 12:03 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Ralf Baechle, Steven Rostedt, Ingo Molnar, linux-mips, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]
On Wed, Jan 17, 2018 at 12:31:57PM +0100, Mathieu Malaterre wrote:
> Replace pointer comparison to 0 with NULL in prepare_ftrace_return
> to improve code readability. Identified with coccinelle script
> 'badzero.cocci'.
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
I've applied to my 4.16 branch,
Thanks
James
> ---
> arch/mips/kernel/ftrace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
> index 99285be0e088..7f3dfdbc3657 100644
> --- a/arch/mips/kernel/ftrace.c
> +++ b/arch/mips/kernel/ftrace.c
> @@ -361,7 +361,7 @@ void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra,
> * If fails when getting the stack address of the non-leaf function's
> * ra, stop function graph tracer and return
> */
> - if (parent_ra_addr == 0)
> + if (parent_ra_addr == NULL)
> goto out;
> #endif
> /* *parent_ra_addr = return_hooker; */
> --
> 2.11.0
>
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-01 12:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 11:31 [PATCH] MIPS: ftrace: Remove pointer comparison to 0 in prepare_ftrace_return Mathieu Malaterre
2018-01-17 21:13 ` James Hogan
2018-02-01 12:03 ` James Hogan
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).