Received: by 10.223.176.5 with SMTP id f5csp112650wra; Tue, 30 Jan 2018 08:50:02 -0800 (PST) X-Google-Smtp-Source: AH8x2247yROj3G9Z6yV+MkFjO6jTVBCj+LjdMAigrdTPV9V9hmr75eRK7+G70vNQ1qvdgcGUiNBg X-Received: by 10.101.83.195 with SMTP id z3mr24700515pgr.133.1517331002823; Tue, 30 Jan 2018 08:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517331002; cv=none; d=google.com; s=arc-20160816; b=A+8EQ58cyqq84mQqfD7+4cDfXEyL4O28e1GexdPJZw5kd8SEHxWAojdmdXlxK8AaZZ LKJWZJvl+QKYy2fnaCbKGvu1S+fiAaIL/jD3pPniNpSm3Q7fV2UwqSEfM97BgF4+akrM xJJZ1FIK2aJ1ojF3hSqByz+sOLuUYq5W/TqZ/KlD1JaZhpuLrMM9+S7FAkGz7BUj/Lle SOhyvf5oYV3+ozzdvdiXjBzL7XywCFn1iYKntNIx6vXIIKhs6wIXZZsprDqqxP44j28c 5Kb+VTpCsizJAxB+PiMKOxrvbAdvBlkdxjadb7oTxjTexIAyv80Y0BUgwn1Qh9ED2Ddq +N1g== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=YaNPnD+5zLMw+tPp6oXgVEYXg9nB54epgclEWrOJt/k=; b=UKek3cKB50f3ZrovcQOmqvSmWV7PZUjAU1yJXecKKCEozt8E15wIxFZGzlC+6eB0zO cJ2Ep1r+YpTyvbA+9iGVhx65zI7ZPR/ys4sw1kPjGuZNwwnwYrpxc29o7wjBQLO/dqIX pARS0tyHd4WL6BgWI+a9oPSSe8+oxLgmKLcrr2ULYapoHn0nn3AIGoxGhtLar4GWFN94 zwbh55WqgGpWAGqUKg4ZlOrqRts8VAL4eO886e8DBbmkT6Ja+Nv9poHsP69xHe7ee7hy ul+lpwPQkPMn4tZAtJCoqf314VG3q3Pazfej8yy+J87GweRMm1rL6MIBQ5sR22H/zYd7 N99Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CQXF4Mwk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b188si16028pgc.452.2018.01.30.08.49.47; Tue, 30 Jan 2018 08:50:02 -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; dkim=pass header.i=@chromium.org header.s=google header.b=CQXF4Mwk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864AbeA3PJa (ORCPT + 99 others); Tue, 30 Jan 2018 10:09:30 -0500 Received: from mail-yw0-f193.google.com ([209.85.161.193]:41101 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbeA3PJ3 (ORCPT ); Tue, 30 Jan 2018 10:09:29 -0500 Received: by mail-yw0-f193.google.com with SMTP id b129so4937849ywa.8 for ; Tue, 30 Jan 2018 07:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YaNPnD+5zLMw+tPp6oXgVEYXg9nB54epgclEWrOJt/k=; b=CQXF4MwkcDBb7T7j+T0mkfn9oaxboG4OUA+S9OK6vdu0BGgkobzKUVHqbOX/GpUBbH DznxL4j0x1wrnUrncNve+x7lrEp4vA3+p/Z03CXL7PFP4VrEnBFlKbhY3MvOnlDqkuZv xxdAi42RsvORHd68/EVeHFqksCjmOwITWKZxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YaNPnD+5zLMw+tPp6oXgVEYXg9nB54epgclEWrOJt/k=; b=F1jSsZFzk71x+pSD/JqeSt1aCAKtXbCX4uYJrxgVHDOEa1oiuPlvtEOPdcllxZfrCl 2fEupg1R4gW8BndGJEQToUUDxGBUx0l0OMPVS6GK9x3WlUpubAGxVUqJZXjsTU2gwU/z 2fImvWS382nhfj+ngci5YMomuOAfNP0Il1w3OP6OE/XEMF3e/TtwA5LMkSrTgjb7s7t7 fOF9Q9cSmXCKRh/uAxXiPG5GJMxOOPCcEbYcURozO3ck3KsIVgz/bwnH+IHyJAepclAx 6Yg2ltriKXFICmUeoC4S/gxSW85b6SYe+ytkVpexnxtzSgHiLIiZwoWqzDHK2U8E76qk ir2A== X-Gm-Message-State: AKwxytcF5huPV0fc1xad76rmatZhBk8KQw3Pt2DOS8srM5piNmD/7ycF VY9HRchllpK1AZtMoIKFbwMKRg== X-Received: by 10.129.109.143 with SMTP id i137mr20046980ywc.462.1517324968717; Tue, 30 Jan 2018 07:09:28 -0800 (PST) Received: from localhost ([2620:0:1013:11:d3af:69ac:1964:28e8]) by smtp.gmail.com with ESMTPSA id q9sm5405922ywl.59.2018.01.30.07.09.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 07:09:28 -0800 (PST) Date: Tue, 30 Jan 2018 10:09:27 -0500 From: Sean Paul To: "Gustavo A. R. Silva" Cc: Daniel Vetter , Gustavo Padovan , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: Re: [PATCH v2] drm/edid: use true and false for boolean values Message-ID: <20180130150927.3fm5kotyp6vqugaf@art_vandelay> References: <20180130100528.GA7154@training> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180130100528.GA7154@training> User-Agent: NeoMutt/20170609 (1.8.3) 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 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. 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