Received: by 10.223.176.5 with SMTP id f5csp13085wra; Tue, 30 Jan 2018 07:21:53 -0800 (PST) X-Google-Smtp-Source: AH8x225yqf1xKd+iXtuaxREiESXacGIOZnXElSZ3vOnLdhQHwWXaWitl+uOs/VflZze7vcAStdPo X-Received: by 2002:a17:902:a03:: with SMTP id 3-v6mr24011930plo.282.1517325713864; Tue, 30 Jan 2018 07:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517325713; cv=none; d=google.com; s=arc-20160816; b=q6XANSTDkcbGy8F/4dZasbJK0X/DaENNiYKR5yDzPWLSOJorcE98ueBBu2Ci/N1PEv BiWtCBWkEI5FgNP6TbWMb1KOd15jHex/BP31ZWpaoS4GTpheXZ2NgMHyzojBMxHmkc1+ F9gnQZQZY1D6uaQytlUirBL3pLKinewckPxh0c0cbXN2rBj1HlteN3sjMlYCUyQ6prBU MgqhQFraPa/tPEd+I0zqN6p0pHMFRRwDJT93wDDRY+8cMQm9dCEMJdiqUnQZNSlMnhWK ht1g8h6hYcLdV2D/Haws+SCv1QG1KlHLx0l0Y78tHFqjY56zPGhcPKLPeJNwD6AdKhYi PSvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=kF+8VlEOz2rnL3HvkR8tvP6Y/dwV7ZoH2LJYvbjkgBo=; b=yneKKsPkDkt5MaNSJ8kTP5d+dFywkN3jbZ4HCLuRxTJN2mKlcuC8xjXnMZG9w39tbA 5V3263P6EJAMBaeMK6HuuRtwywZQdZJ+y/1F4Pr17yIYEozH/8JVsYQ9Tla1umHp8wNw z372s+XGk41pf7JNAaaSfPZjLcoYhIvOfmJibxHa3+vSSXscYd9ecRiy4BoH5ZoHsxZM OI/OPMi7aHQ3SYwPj9ZJBMkBphpchcMeTokVmwMm7EvIe+LxcKHsOMN3rlgISDJrKlFZ uHMTkIWCW/TXEjldfEVaXP7Ajd2mii7s1D4nvAjhPEBiDCHGwzc+OwRR5RXuhjY5a/2v cb4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay2-v6si2292015plb.664.2018.01.30.07.21.39; Tue, 30 Jan 2018 07:21:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752699AbeA3PTv (ORCPT + 99 others); Tue, 30 Jan 2018 10:19:51 -0500 Received: from mga18.intel.com ([134.134.136.126]:32965 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbeA3PTu (ORCPT ); Tue, 30 Jan 2018 10:19:50 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 07:19:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,435,1511856000"; d="scan'208";a="27468696" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 30 Jan 2018 07:19:46 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 30 Jan 2018 17:19:46 +0200 Date: Tue, 30 Jan 2018 17:19:46 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Sean Paul Cc: "Gustavo A. R. Silva" , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , "Gustavo A. R. Silva" Subject: Re: [PATCH v2] drm/edid: use true and false for boolean values Message-ID: <20180130151946.GC5453@intel.com> References: <20180130100528.GA7154@training> <20180130150927.3fm5kotyp6vqugaf@art_vandelay> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180130150927.3fm5kotyp6vqugaf@art_vandelay> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 30, 2018 at 10:09:27AM -0500, Sean Paul wrote: > On Tue, Jan 30, 2018 at 04:05:28AM -0600, Gustavo A. R. Silva wrote: > > Assign true or false to boolean variables instead of an integer value. > > > > This issue was detected with the help of Coccinelle. > > I suppose you could also fix up the other preferred assignment by adding !! > to the bitwise & operation. Assigning >1 to a bool is well defined. No need to clutter the code with !! imo. > > It's also helpful to post the spatch in the commit message so others can > replicate your result (this case is pretty trivial, so less important). > > Sean > > > > > Signed-off-by: Gustavo A. R. Silva > > --- > > Changes in v2: > > - Use true for boolean value in add_detailed_mode as suggested by Daniel > > Vetter. > > - Update subject. > > > > drivers/gpu/drm/drm_edid.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > index ddd5379..b1cb262 100644 > > --- a/drivers/gpu/drm/drm_edid.c > > +++ b/drivers/gpu/drm/drm_edid.c > > @@ -2767,7 +2767,7 @@ do_detailed_mode(struct detailed_timing *timing, void *c) > > > > drm_mode_probed_add(closure->connector, newmode); > > closure->modes++; > > - closure->preferred = 0; > > + closure->preferred = false; > > } > > } > > > > @@ -2784,7 +2784,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid, > > struct detailed_mode_closure closure = { > > .connector = connector, > > .edid = edid, > > - .preferred = 1, > > + .preferred = true, > > .quirks = quirks, > > }; > > > > -- > > 2.7.4 > > > > -- > Sean Paul, Software Engineer, Google / Chromium OS > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel OTC