From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756372AbdJJOfG (ORCPT ); Tue, 10 Oct 2017 10:35:06 -0400 Received: from mga06.intel.com ([134.134.136.31]:64137 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751364AbdJJOfE (ORCPT ); Tue, 10 Oct 2017 10:35:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,505,1500966000"; d="scan'208";a="908543983" Message-ID: <1507646100.7677.24.camel@linux.intel.com> Subject: Re: [PATCH] drm/i915: remove redundant check on has_aliasing_ppgtt From: Joonas Lahtinen To: Colin King , Jani Nikula , Rodrigo Vivi , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 10 Oct 2017 17:35:00 +0300 In-Reply-To: <20171010134733.17516-1-colin.king@canonical.com> References: <20171010134733.17516-1-colin.king@canonical.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.5 (3.24.5-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-10-10 at 14:47 +0100, Colin King wrote: > From: Colin Ian King > > There is a previous check to on has_aliasing_ppgtt that returns > 0 if it is false, so it is impossible for has_aliasing_ppgtt to > be false on the final return of function intel_sanitize_enable_ppgtt, > so final return in the function always will return 1. Hence the > redundant ternary operator can be replaced with a return 1. > > Detected by CoverityScan, CID#1357136 ("Logically dead code") > > Signed-off-by: Colin Ian King Thanks, I took it a few steps further and removed the variable altogether. I Cc'd you on the patch. Regards, Joonas -- Joonas Lahtinen Open Source Technology Center Intel Corporation