vmgfx gcc-7.1.1 warning..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This one actually seems to imply that vmw_cmd_invalid() is broken:

drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:522:34: warning: the omitted
middle operand in ?: will always be ‘true’, suggest explicit middle
operand [-Wparentheses]
  return capable(CAP_SYS_ADMIN) ? : -EINVAL;
                                  ^

gcc is very right. I think the *intent* of that function is to return
0 if CAP_SYS_ADMIN, but it always returns nonzero.

If CAP_SYS_ADMIN is true, it returns 1, and if it's false it returns -EINVAL.

Since nobody has noticed in many many years, maybe it should just
always return -EINVAL unconditionally?

               Linus
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux