Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8117E95372 for ; Wed, 4 Feb 2026 10:07:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7161710E5A6; Wed, 4 Feb 2026 10:07:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BaLNzIL4"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 760D510E5A6 for ; Wed, 4 Feb 2026 10:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1770199657; x=1801735657; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=EH0ZG3SkO771bIq5WutYlFmitCrnZ5AIsPPM83Tpg0g=; b=BaLNzIL40DjeVJNlWAVEELOf66Zh6dIDkav9Dp7MT2mdorramePyl1nU oT4QqpjXCuA7MhM0DPRGV7RE169CWMNw9OHeZSo8AIpsNHFaLYZx4B09l QfH4BvHy6R/7aHGZfD2BayxphKUL5pcawMRf3WMvvXPIq/8Nez+mQvJM9 831dBblewLrx2SA3BJivYcvXpeHjmV78cTkWd6xFqkW2vJAkyPZ+k1qh4 iMOXwnmb+JCz+hUgd6TacxJ0SwlLn9MWQ+F2jYkkEhn9WfY+CcRFAvah2 Ag2Ip9ke+BQFqtt/lJTuMit+WfpUaSsRrCe1B6r2+RDc1U3C2AMCb9z66 w==; X-CSE-ConnectionGUID: kWurllW2R2S8XOsl8rd12A== X-CSE-MsgGUID: T5wpL4WtS4q5nAk/yUMdIA== X-IronPort-AV: E=McAfee;i="6800,10657,11691"; a="71287669" X-IronPort-AV: E=Sophos;i="6.21,272,1763452800"; d="scan'208";a="71287669" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2026 02:07:37 -0800 X-CSE-ConnectionGUID: elHuVbTpRYOh13jg/Xueow== X-CSE-MsgGUID: 0DfGrjDXRM6qGGJc8uo8Iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,272,1763452800"; d="scan'208";a="247712070" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.246.7]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2026 02:07:35 -0800 From: Jani Nikula To: Jonathan Cavitt , intel-gfx@lists.freedesktop.org Cc: saurabhg.gupta@intel.com, alex.zuo@intel.com, jonathan.cavitt@intel.com Subject: Re: [PATCH] drm/i915/gvt: No need for extra op check In-Reply-To: <20260203223642.7052-2-jonathan.cavitt@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland References: <20260203223642.7052-2-jonathan.cavitt@intel.com> Date: Wed, 04 Feb 2026 12:07:31 +0200 Message-ID: <082f48353e0dd9aa62a0bf10c0c95094f8702296@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 03 Feb 2026, Jonathan Cavitt wrote: > Static analysis issue: > > In intel_gvt_i2c_handle_aux_ch_write, we check if op & 0x1 == 0. If it > does not equal zero, then it must equal one, so checking op & 0x1 == 1 > in the case it does not equal zero is unnecessary. > > Signed-off-by: Jonathan Cavitt > Cc: Jani Nikula > --- > drivers/gpu/drm/i915/gvt/edid.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gvt/edid.c b/drivers/gpu/drm/i915/gvt/edid.c > index 021afff1cd5d..5ac7636d6c07 100644 > --- a/drivers/gpu/drm/i915/gvt/edid.c > +++ b/drivers/gpu/drm/i915/gvt/edid.c > @@ -543,8 +543,6 @@ void intel_gvt_i2c_handle_aux_ch_write(struct intel_vgpu *vgpu, > * support the gfx driver to do EDID access. > */ The context here is } else if ((op & 0x1) == DP_AUX_I2C_WRITE) { /* TODO * We only support EDID reading from I2C_over_AUX. And * we do not expect the index mode to be used. Right now * the WRITE operation is ignored. It is good enough to * support the gfx driver to do EDID access. */ } else { and you could also toss the empty branch to the curb and check for } else if ((op & 0x1) == DP_AUX_I2C_READ) { > } else { > - if (drm_WARN_ON(&i915->drm, (op & 0x1) != DP_AUX_I2C_READ)) > - return; > if (drm_WARN_ON(&i915->drm, msg_length != 4)) > return; > if (i2c_edid->edid_available && i2c_edid->target_selected) { -- Jani Nikula, Intel