Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1647636 > unrolled thread

Re: [PATCH 3/7] kernel-trace: Adjust two checks for null pointers in compatible_field()

Started bySteven Rostedt <rostedt@goodmis.org>
First post2017-05-23 07:20 +0200
Last post2017-05-23 07:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/7] kernel-trace: Adjust two checks for null pointers  in compatible_field() Steven Rostedt <rostedt@goodmis.org> - 2017-05-23 07:20 +0200

#1647636 — Re: [PATCH 3/7] kernel-trace: Adjust two checks for null pointers in compatible_field()

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-05-23 07:20 +0200
SubjectRe: [PATCH 3/7] kernel-trace: Adjust two checks for null pointers in compatible_field()
Message-ID<tKaoF-7aM-5@gated-at.bofh.it>
On Fri, 5 May 2017 23:03:23 +0200
SF Markus Elfring <elfring@users.sourceforge.net> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 May 2017 20:00:11 +0200
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> The script “checkpatch.pl” pointed information out like the following.
> 
> Comparison to NULL could be written !…
> 
> Thus fix the affected source code place.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  kernel/trace/trace_events_hist.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_events_hist.c
> b/kernel/trace/trace_events_hist.c index df566e21344d..36412deac24c
> 100644 --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -1324,7 +1324,7 @@ static bool compatible_field(struct
> ftrace_event_field *field, {
>  	if (field == test_field)
>  		return true;
> -	if (field == NULL || test_field == NULL)
> +	if (!field || !test_field)

The first two are fine, this one isn't needed.

-- Steve

>  		return false;
>  	if (strcmp(field->name, test_field->name) != 0)
>  		return false;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web