linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Colin King <colin.king@canonical.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	"David S . Miller" <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools lib traceevent: fix an incorrect comparison with the literal "s64"
Date: Thu, 30 Nov 2017 19:21:15 -0500	[thread overview]
Message-ID: <20171130192115.03d93d38@gandalf.local.home> (raw)
In-Reply-To: <20171127161909.15565-1-colin.king@canonical.com>


Arnaldo,

Can you take this in your tree. And mark it for stable. Thanks!

On Mon, 27 Nov 2017 16:19:09 +0000
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> I believe the comparison of the string 'type' with the literal string
> "s64" is currently incorrect, it is missing a == 0 comparison as per
> the other comparisons.
> 
> Detected by cppcheck:
> tools/lib/traceevent/event-parse.c:2209: (warning) The comparison
> operator in 'strcmp(type,"s64") != 0' should maybe be '==' instead,
> currently the expression 'strcmp(type,"u64") == 0' is redundant.
> 
> Fixes: f7d82350e597 ("tools/events: Add files to create libtraceevent.a")

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  tools/lib/traceevent/event-parse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index 7ce724fc0544..82b6c64c5b39 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -2206,7 +2206,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer)
>  		return val & 0xffffffff;
>  
>  	if (strcmp(type, "u64") == 0 ||
> -	    strcmp(type, "s64"))
> +	    strcmp(type, "s64") == 0)
>  		return val;
>  
>  	if (strcmp(type, "s8") == 0)

      reply	other threads:[~2017-12-01  0:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 16:19 [PATCH] tools lib traceevent: fix an incorrect comparison with the literal "s64" Colin King
2017-12-01  0:21 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171130192115.03d93d38@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=acme@redhat.com \
    --cc=colin.king@canonical.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).