On Tue, 03 Feb 2026, Jonathan Cavitt <[email protected]> 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 <[email protected]>
> Cc: Jani Nikula <[email protected]>
> ---
> 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