Re: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning

2017-07-17 Thread Sinclair Yeh
On Fri, Jul 14, 2017 at 10:28:29PM +0200, Arnd Bergmann wrote: > On Fri, Jul 14, 2017 at 9:23 PM, Linus Torvalds > wrote: > > On Fri, Jul 14, 2017 at 12:21 PM, Linus Torvalds > > wrote: > >> > >> NAK. This takes unintentionally insane code and turns it intentionally > >> insane. Any non-zero retu

Re: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning

2017-07-14 Thread Arnd Bergmann
On Fri, Jul 14, 2017 at 9:23 PM, Linus Torvalds wrote: > On Fri, Jul 14, 2017 at 12:21 PM, Linus Torvalds > wrote: >> >> NAK. This takes unintentionally insane code and turns it intentionally >> insane. Any non-zero return is considered an error. >> >> The right fix is almost certainly to just re

Re: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning

2017-07-14 Thread Linus Torvalds
On Fri, Jul 14, 2017 at 12:21 PM, Linus Torvalds wrote: > > NAK. This takes unintentionally insane code and turns it intentionally > insane. Any non-zero return is considered an error. > > The right fix is almost certainly to just return -EINVAL unconditionally. Btw, this is why I hate compiler w

Re: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning

2017-07-14 Thread Linus Torvalds
On Fri, Jul 14, 2017 at 2:25 AM, Arnd Bergmann wrote: > - return capable(CAP_SYS_ADMIN) ? : -EINVAL; > + return capable(CAP_SYS_ADMIN) ? 1 : -EINVAL; NAK. This takes unintentionally insane code and turns it intentionally insane. Any non-zero return is considered an error. The right f

Re: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning

2017-07-14 Thread Jani Nikula
On Fri, 14 Jul 2017, Arnd Bergmann wrote: > gcc-7 warns about slightly suspicious code in vmw_cmd_invalid: > > drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c: In function 'vmw_cmd_invalid': > drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:522:23: error: the omitted middle > operand in ?: will always be 'true',

[PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning

2017-07-14 Thread Arnd Bergmann
gcc-7 warns about slightly suspicious code in vmw_cmd_invalid: drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c: In function 'vmw_cmd_invalid': drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:522:23: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parenthes