From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754921AbdCGIdd (ORCPT ); Tue, 7 Mar 2017 03:33:33 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:38205 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754745AbdCGId0 (ORCPT ); Tue, 7 Mar 2017 03:33:26 -0500 Date: Tue, 7 Mar 2017 09:33:14 +0100 (CET) From: Thomas Gleixner To: Ingo Molnar cc: kbuild test robot , Rik van Riel , kbuild-all@01.org, LKML , tipbuild@zytor.com, "H. Peter Anvin" , x86@kernel.org, Dave Hansen , Yu-cheng Yu , Fenghua Yu , Borislav Petkov , Peter Zijlstra Subject: Re: [PATCH] x86/fpu: fix boolreturn.cocci warnings In-Reply-To: <20170307072322.GB29708@gmail.com> Message-ID: References: <201703060848.Q2LHSMc4%fengguang.wu@intel.com> <20170306004553.GA25764@lkp-wsm-ep1> <20170307072322.GB29708@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 Mar 2017, Ingo Molnar wrote: > > * kbuild test robot wrote: > > > arch/x86/kernel/fpu/xstate.c:931:9-10: WARNING: return of 0/1 in function 'xfeatures_mxcsr_quirk' with return type bool > > > > Return statements in functions returning bool should use > > true/false instead of 1/0. > > Note that this is a totally bogus warning. I personally find a 0/1 return more > readable than a textual 'true/false', even if bools are used, and nowhere does the > kernel mandate the use of 0/1. I disagree. The fact that booleans have been brought retroactively into the C-Standard does and for compability reasons C still follows the approach "Boolean values are just integers" does not make it any better. We had stupid bugs, where people returned -EINVAL from a boolean function and introduced silly and hard to understand bugs. The canonical values assigned to booleans are 'true' and 'false' and not whatever people prefer. Can we please be consistent on that? Thanks, tglx