From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753361AbcGDIib (ORCPT ); Mon, 4 Jul 2016 04:38:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50750 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbcGDIia (ORCPT ); Mon, 4 Jul 2016 04:38:30 -0400 Date: Mon, 4 Jul 2016 16:38:26 +0800 From: Baoquan He To: Mark Brown Cc: lgirdwood@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] regulator: core: Assign bool value to variable has_full_constraints Message-ID: <20160704083826.GC4634@x1.redhat.com> References: <1467597925-10490-1-git-send-email-bhe@redhat.com> <20160704081238.GQ6247@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160704081238.GQ6247@sirena.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 04 Jul 2016 08:38:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/04/16 at 10:12am, Mark Brown wrote: > On Mon, Jul 04, 2016 at 10:05:25AM +0800, Baoquan He wrote: > > > In commit 21cf891a (regulator: Make regulator_has_full_constraints a bool) > > type of variable has_full_constraints is changed to bool, so assign 'true' > > to has_full_constraints here. > > There is no need to make changes like this, C has full support for using > integers in a boolean context - using true here would've been just as > meaningful with an integer variable and using a number for a boolean > variable is fully equivalent. By the way, I still think it makes code more read-able to assign a bool value to a bool variable. In your words, C truly has full support for using integers in a boolean context, then commit 21cf891a is not necessary to be made to change.