Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17268836ybl; Thu, 2 Jan 2020 02:06:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyy+JqS0eHTzbsXMyreNw+pCWvmPiGp8o5tzZAl9VXZlBGPQhNQCVprWOhFso2UBBK28D2x X-Received: by 2002:a05:6830:1cc5:: with SMTP id p5mr66740367otg.218.1577959599988; Thu, 02 Jan 2020 02:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577959599; cv=none; d=google.com; s=arc-20160816; b=ADHJe08MZ3eVRtc5eJ0ARqNmGf7Vdp76WfWfVzNqgTIor5hJbv9Q89WyMjoVXvBhKe dYRbBBdMwLkxAtF6S9S8Ym5IE7MnU74AbRlhnwgiLxXvkTKdebs4XPCNfPGU0SpAoaKI lmND1W4hgqSCigoEHIEKQ8kqlMtTjUn8yTeQBA5KXFu3+f79HjvTUEFBixcJw8eRRH7v xpjdGVOPvuCxWuHUWYHhhNcUZbgre3COMvX/ZfkMqQ7kHeUfU8RTnQC/t0LT5bsRQgck AHOezboiqtOjC35j3Uoc8krxQOZAgcgNw/dejY07KDfz2c3NSDDgL1NoiP0n96NYWREj fF1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:to:from; bh=Cghqqry7azZQpngh41IrIko97z3bnTtMsFNaSt58FPA=; b=QXfz0vs7vhMF7xT77DqZM/4Spm/Pv3oCAs6pQTRyzQt9fR7Ne9I/iTyb2LrVXhmrzO bGeTs6ji1LySQ0A5XMHrRzubwM+kwPjEjtjwbjkzzQf1v/DzxrV5S9V/aA/wukJ3BG8K im0L1eJzR9djbriwP9uJkvSoQ+pddm3c8tRnIMhiYnbsRJsjvuWyynrTOW3/1v6xC6gX jdIzKT8Vc78a024kBjKiVfxaEIVh6Sp6sYSmkVmcI1Y3u1YxLwGkuukhTBMAjRpKO0hr vnki6C9/PiqiTecqoy0cXyZPRzcP/E9tNSodb2FiyT9ynAYj8ND6NXBQV0xXSh+nvNhu DoiQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si29853572otq.315.2020.01.02.02.06.27; Thu, 02 Jan 2020 02:06:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727978AbgABKFp (ORCPT + 99 others); Thu, 2 Jan 2020 05:05:45 -0500 Received: from mga11.intel.com ([192.55.52.93]:1240 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727987AbgABKFp (ORCPT ); Thu, 2 Jan 2020 05:05:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 02:05:44 -0800 X-IronPort-AV: E=Sophos;i="5.69,386,1571727600"; d="scan'208";a="214112239" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.161]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 02:05:40 -0800 From: Jani Nikula To: Wambui Karuga , joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915: remove boolean comparisons in conditionals. In-Reply-To: <20200102094921.6274-1-wambui.karugax@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200102094921.6274-1-wambui.karugax@gmail.com> Date: Thu, 02 Jan 2020 12:05:38 +0200 Message-ID: <87eewitbpp.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 02 Jan 2020, Wambui Karuga wrote: > Remove unnecessary comparisons to true/false in if statements. > Issues found by coccinelle. > > Signed-off-by: Wambui Karuga Thanks for the patch. Reviewed-by: Jani Nikula > --- > drivers/gpu/drm/i915/display/intel_ddi.c | 2 +- > drivers/gpu/drm/i915/display/intel_dp.c | 2 +- > drivers/gpu/drm/i915/display/intel_sdvo.c | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c > index 9ba794cb9b4f..c065078b3be2 100644 > --- a/drivers/gpu/drm/i915/display/intel_ddi.c > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c > @@ -1812,7 +1812,7 @@ void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state, > u32 temp; > > temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); > - if (state == true) > + if (state) > temp |= TRANS_DDI_DP_VC_PAYLOAD_ALLOC; > else > temp &= ~TRANS_DDI_DP_VC_PAYLOAD_ALLOC; > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index aa515261cb9f..93140c75386a 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -4958,7 +4958,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) > WARN_ON_ONCE(intel_dp->active_mst_links < 0); > bret = intel_dp_get_sink_irq_esi(intel_dp, esi); > go_again: > - if (bret == true) { > + if (bret) { > > /* check link status - esi[10] = 0x200c */ > if (intel_dp->active_mst_links > 0 && > diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c > index 47f5d87a938a..cff254c52f5e 100644 > --- a/drivers/gpu/drm/i915/display/intel_sdvo.c > +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c > @@ -3292,8 +3292,8 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, > if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) > goto err; > > - if (intel_sdvo_output_setup(intel_sdvo, > - intel_sdvo->caps.output_flags) != true) { > + if (!intel_sdvo_output_setup(intel_sdvo, > + intel_sdvo->caps.output_flags)) { > DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", > SDVO_NAME(intel_sdvo)); > /* Output_setup can leave behind connectors! */ -- Jani Nikula, Intel Open Source Graphics Center