Received: by 10.223.176.5 with SMTP id f5csp121516wra; Tue, 30 Jan 2018 08:58:08 -0800 (PST) X-Google-Smtp-Source: AH8x224Tn4faD+brEzhDK0FeCKUEK+bu29YRJKrk1/5H67L3z/3CAp5m6VuyeWnJ5o93K6M+By7d X-Received: by 10.98.10.199 with SMTP id 68mr3214145pfk.202.1517331488007; Tue, 30 Jan 2018 08:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517331487; cv=none; d=google.com; s=arc-20160816; b=h+vGrRyFi1BwOzHEoEgLrFEwhk4aHzqZVxVU8YDbEu3qGZ+CpWCfRxsl5jdZ0XtxJH qUr5yD17OwlhJj05sufMnX4YZRTOZ9UHYdcUQNXRgy5g198sAuDztOxaKDxl+TCmc5ng Pkd6zhWk7Iml4hpEea0XR3DfUw5Hbqcl+gGoRKA+60FCqi0xgpoygTbJjxQ7lutDG0SK 0GIDlhsbfPST+oqdBFJAKBTgt9gEnRCAilh2RoFuqeKZZG+VQggTl3esMjUnsA7kCvM6 du6bued+Tez6/RHtX12I5ZAq+vtN+cbV4FCIQRQfbqzl7SR84OKLlDZlj5eO+VOXE3PV 1Kmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:organization:in-reply-to:subject:cc:to :from:arc-authentication-results; bh=6pcapZjAzLw8afxbqNt6x3sXbZp/TSE3cqiQ0nAjJEU=; b=H2FiDzHDKA4t0Z5gmKV1/ZsKImZZlhMx3yCmIEsp7zSen/eSWIVz9h4lL/JD7Sr1Tt 8u7fHmkkhUC5qq9G9MxAh0Zg+89jesFRF3hmPYW2MOt3pnGOs5sPJt2M9yGcMuALmWLM Ajup6hZqaJpozhBDnE4I4XyEi98UlDOAqkDmZZf276BfQm2f6+F10WotE/0YiJLwyiPJ gNYmhRjSc5v9ilVr6kbLj2i+62QZrZ9Y3IPb3TX/A1CSyxi6q25qkhRyp1G3RFQdCUBi QwUqlRvXYGX14zV2hxWVu7/gbnudPMnldm5o76R9JKoMMlKbyDDrIr7TAZVqqvrjZeuK EfKg== 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 b1si9463535pge.137.2018.01.30.08.57.53; Tue, 30 Jan 2018 08:58:07 -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 S1753205AbeA3PcM convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Jan 2018 10:32:12 -0500 Received: from mga01.intel.com ([192.55.52.88]:61264 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531AbeA3PcL (ORCPT ); Tue, 30 Jan 2018 10:32:11 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2018 07:32:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,435,1511856000"; d="scan'208";a="26655597" Received: from kumarvi1-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.51.113]) by fmsmga001.fm.intel.com with ESMTP; 30 Jan 2018 07:32:04 -0800 From: Jani Nikula To: Ville =?utf-8?B?U3lyasOkbMOk?= , Sean Paul Cc: "Gustavo A. R. Silva" , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, "Gustavo A. R. Silva" , Daniel Vetter Subject: Re: [PATCH v2] drm/edid: use true and false for boolean values In-Reply-To: <20180130151946.GC5453@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20180130100528.GA7154@training> <20180130150927.3fm5kotyp6vqugaf@art_vandelay> <20180130151946.GC5453@intel.com> Date: Tue, 30 Jan 2018 17:31:59 +0200 Message-ID: <87607jwefk.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Jan 2018, Ville Syrjälä wrote: > 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. Agreed. BR, Jani. > >> >> 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 -- Jani Nikula, Intel Open Source Technology Center