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: Tue, 3 Oct 2023 09:07:44 -0400 [thread overview]
Message-ID: <20231003090744.07da45cc@gandalf.local.home> (raw)
In-Reply-To: <20231002143715.229dffe5@gandalf.local.home>
On Mon, 2 Oct 2023 14:37:15 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> 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
I still can't remember why I didn't convert ssize_t, so maybe it was not a
real reason. I'll send a v2 changing the type to ssize_t and if there was a
reason I didn't do that before, maybe it will show up when I make the
change!
-- Steve
prev parent reply other threads:[~2023-10-03 13:06 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
2023-10-03 13:07 ` 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=20231003090744.07da45cc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.