From: Steven Rostedt <rostedt@goodmis.org>
To: Ross Zwisler <zwisler@google.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>,
Stevie Alvarez <stevie.6strings@gmail.com>
Subject: Re: [PATCH] libtraceeval: Fix comparing unsigned against zero
Date: Mon, 2 Oct 2023 14:37:15 -0400 [thread overview]
Message-ID: <20231002143715.229dffe5@gandalf.local.home> (raw)
In-Reply-To: <20231002183102.GA1512616@google.com>
On Mon, 2 Oct 2023 12:31:02 -0600
Ross Zwisler <zwisler@google.com> wrote:
> > @@ -303,14 +303,14 @@ struct traceeval *traceeval_init(struct traceeval_type *keys,
> >
> > /* alloc key types */
> > teval->nr_key_types = type_alloc(keys, &teval->key_types);
> > - if (teval->nr_key_types <= 0) {
> > + if ((ssize_t)teval->nr_key_types <= 0) {
>
> Rather than casting, wouldn't it be better to just change the type of
> nr_key_types and nr_val_types to ssize_t? I think this should be the return
> type of type_alloc() as well, since this returns -1 on error.
I thought about that, and there was a reason against it. But I forgot what
that was :-p
-- Steve
next prev parent reply other threads:[~2023-10-02 18:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 8:16 [PATCH] libtraceeval: Fix comparing unsigned against zero Steven Rostedt
2023-10-02 18:31 ` Ross Zwisler
2023-10-02 18:37 ` Steven Rostedt [this message]
2023-10-03 13:07 ` Steven Rostedt
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=20231002143715.229dffe5@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=stevie.6strings@gmail.com \
--cc=zwisler@google.com \
/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).