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

Linus Torvalds torvalds at linux-foundation.org
Fri Jul 14 19:23:15 UTC 2017


On Fri, Jul 14, 2017 at 12:21 PM, Linus Torvalds
<torvalds at linux-foundation.org> 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 warning fix patch series. Even when
they don't actually break the code (and sometimes they do that too),
they can actually end up making the code worse.

The *intent* of that code was to return zero for the CAP_SYS_ADMIN.
But the code has never done that in its lifetime and nobody ever
noticed, so clearly the code shouldn't even have tried.

                    Linus


More information about the dri-devel mailing list