Re: [Intel-gfx] [PATCH] Make is_signed_type() simpler

2019-09-30 Thread Ruhl, Michael J
vger.kernel.org; rost...@goodmis.org; mi...@redhat.com >Subject: [Intel-gfx] [PATCH] Make is_signed_type() simpler > >* Simply compare -1 with 0, >* Drop unnecessary parenthesis sets > >New macro leaves pointer as "unsigned type" but gives a warning, >which shoul

Re: [Intel-gfx] [PATCH] Make is_signed_type() simpler

2019-09-30 Thread Rasmus Villemoes
On 29/09/2019 23.09, Alexey Dobriyan wrote: > 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)) <

Re: [Intel-gfx] [PATCH] Make is_signed_type() simpler

2019-09-29 Thread Steven Rostedt
On Sun, 29 Sep 2019 23:44:24 +0300 Alexey Dobriyan wrote: > On Sun, Sep 29, 2019 at 04:15:31PM -0400, Steven Rostedt wrote: > > On Sun, 29 Sep 2019 23:06:19 +0300 > > Alexey Dobriyan wrote: > > > > > * Simply compare -1 with 0, > > > * Drop unnecessary parenthesis sets > > > > > > New macro

Re: [PATCH] Make is_signed_type() simpler

2019-09-29 Thread Alexey Dobriyan
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)

Re: [PATCH] Make is_signed_type() simpler

2019-09-29 Thread Alexey Dobriyan
On Sun, Sep 29, 2019 at 04:15:31PM -0400, Steven Rostedt wrote: > On Sun, 29 Sep 2019 23:06:19 +0300 > Alexey Dobriyan wrote: > > > * Simply compare -1 with 0, > > * Drop unnecessary parenthesis sets > > > > New macro leaves pointer as "unsigned type" but gives a warning, > > which should be

Re: [PATCH] Make is_signed_type() simpler

2019-09-29 Thread Rasmus Villemoes
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

Re: [PATCH] Make is_signed_type() simpler

2019-09-29 Thread Steven Rostedt
On Sun, 29 Sep 2019 23:06:19 +0300 Alexey Dobriyan wrote: > * Simply compare -1 with 0, > * Drop unnecessary parenthesis sets > > New macro leaves pointer as "unsigned type" but gives a warning, > which should be fine because asking whether a pointer is signed is > strange question. > > I'm

[PATCH] Make is_signed_type() simpler

2019-09-29 Thread Alexey Dobriyan
* Simply compare -1 with 0, * Drop unnecessary parenthesis sets New macro leaves pointer as "unsigned type" but gives a warning, which should be fine because asking whether a pointer is signed is strange question. I'm not sure what's going on in the i915 driver, it is shipping kernel pointers to