From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754283AbbBRTJd (ORCPT ); Wed, 18 Feb 2015 14:09:33 -0500 Received: from mga02.intel.com ([134.134.136.20]:14483 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753987AbbBRTJc (ORCPT ); Wed, 18 Feb 2015 14:09:32 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,603,1418112000"; d="scan'208";a="679943853" From: "Moore, Robert" To: "Rafael J. Wysocki" , Quentin Lambert CC: "Zhang, Rui" , "Zheng, Lv" , "Wysocki, Rafael J" , Len Brown , Shaohua Li , "linux-acpi@vger.kernel.org" , "devel@acpica.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 0/4] int to bool conversion Thread-Topic: [PATCH 0/4] int to bool conversion Thread-Index: AQHQNiBbsAzX80JxxU6GH9h/ZAwAPpzM1+iAgAXGwYCAAFRWAIAj/UgQ Date: Wed, 18 Feb 2015 19:09:28 +0000 Message-ID: <94F2FBAB4432B54E8AACC7DFDE6C92E37D27FE3F@ORSMSX112.amr.corp.intel.com> References: <20150122084941.GA14651@sloth> <1659960.ohcxabvmYi@vostro.rjw.lan> <54C5FB3F.6000803@gmail.com> <2189735.DtT3OIbRBT@vostro.rjw.lan> In-Reply-To: <2189735.DtT3OIbRBT@vostro.rjw.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t1IJ9c1H025387 "bool" can be problematic as it isn't totally portable. It is usually implemented as a macro. That’s why ACPICA doesn't use it. > -----Original Message----- > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Sent: Monday, January 26, 2015 5:33 AM > To: Quentin Lambert > Cc: Zhang, Rui; Moore, Robert; Zheng, Lv; Wysocki, Rafael J; Len Brown; > Shaohua Li; linux-acpi@vger.kernel.org; devel@acpica.org; linux- > kernel@vger.kernel.org > Subject: Re: [PATCH 0/4] int to bool conversion > > On Monday, January 26, 2015 09:30:55 AM Quentin Lambert wrote: > > Sorry for the delay in answering .... > > > > On 22/01/2015 17:18, Rafael J. Wysocki wrote: > > > On Thursday, January 22, 2015 09:49:41 AM Quentin Lambert wrote: > > >> These patches convert local variables from int to bool when relevant. > > > And what exactly is the need for that? Does that fix any functional > problems? > > > > > > > > It doesn't fix any functional problem. The point of this patch is to > > increase the code readability by lifting some of the ambiguities that > > appear when using an integer variable as boolean. > > > > My understanding is that by explicitly using a boolean declaration > > when it is relevant it clearly informs the reader that the variable is > > going to represent a binary state. Moreover, using the keywords true > > and false help indicate that the variable will not be involved in any > > computation other than boolean arithmetic. > > Well, in the new code, yes. The existing code is a different matter > though and it doesn't actually hurt if you leave the ints where they are, > so there's no reason to make those changes. > > If you change old code and the change is not trivial (eg. fixes of white > space or comments, or kernel messages etc.) and someone enounters a bug > that may be related to it, they will have to go through your changes to > see if that's not the source of the bug. That's not really productive. > > > -- > I speak only for myself. > Rafael J. Wysocki, Intel Open Source Technology Center. {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I