From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: Re: [PATCH] Make is_signed_type() simpler Date: Mon, 30 Sep 2019 00:09:08 +0300 Message-ID: <20190929210908.GA14456@avx2> References: <20190929200619.GA12851@avx2> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Rasmus Villemoes 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 List-Id: intel-gfx@lists.freedesktop.org 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.