linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com, intel-gfx@lists.freedesktop.org,
	rostedt@goodmis.org, mingo@redhat.com
Subject: Re: [PATCH] Make is_signed_type() simpler
Date: Mon, 30 Sep 2019 00:09:08 +0300	[thread overview]
Message-ID: <20190929210908.GA14456@avx2> (raw)
In-Reply-To: <f99ca43d-1ba2-95fb-b90f-6706a06f8ce6@rasmusvillemoes.dk>

On Sun, Sep 29, 2019 at 10:21:48PM +0200, Rasmus Villemoes wrote:
> On 29/09/2019 22.06, Alexey Dobriyan wrote:
> > * Simply compare -1 with 0,
> > * Drop unnecessary parenthesis sets
> > 
> > -#define is_signed_type(type)       (((type)(-1)) < (type)1)
> > +#define is_signed_type(type)       ((type)-1 < 0)
> 
> NAK. I wrote it that way to avoid -Wtautological-compare when type is
> unsigned.

Was is W=1?

godbolt doesn't show it with just -Wall

	https://godbolt.org/z/kCA7mm

And the warning which found i915 case is -Wextra not -Wtautological-compare.

  reply	other threads:[~2019-09-29 21:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29 20:06 [PATCH] Make is_signed_type() simpler Alexey Dobriyan
2019-09-29 20:15 ` Steven Rostedt
2019-09-29 20:44   ` Alexey Dobriyan
2019-09-29 21:16     ` Steven Rostedt
2019-09-29 20:21 ` Rasmus Villemoes
2019-09-29 21:09   ` Alexey Dobriyan [this message]
2019-09-30  6:16     ` Rasmus Villemoes
2019-09-30 18:34 ` [Intel-gfx] " Ruhl, Michael J

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=20190929210908.GA14456@avx2 \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mingo@redhat.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=rostedt@goodmis.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).