Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751105AbdGNTVQ (ORCPT ); Fri, 14 Jul 2017 15:21:16 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:34056 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750786AbdGNTVO (ORCPT ); Fri, 14 Jul 2017 15:21:14 -0400 MIME-Version: 1.0 In-Reply-To: <20170714092540.1217397-4-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> <20170714092540.1217397-4-arnd@arndb.de> From: Linus Torvalds Date: Fri, 14 Jul 2017 12:21:13 -0700 X-Google-Sender-Auth: 30Hl0sBFrBQWP05hL2-aNCHgTsg Message-ID: Subject: Re: [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning To: Arnd Bergmann Cc: Linux Kernel Mailing List , VMware Graphics , Sinclair Yeh , Thomas Hellstrom , David Airlie , Greg Kroah-Hartman , Tejun Heo , Guenter Roeck , IDE-ML , Linux Media Mailing List , Andrew Morton , DRI , Brian Paul Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 402 Lines: 10 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 fix is almost certainly to just return -EINVAL unconditionally. Linus