]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/i915/gvt: Swap read and write checks
authorJonathan Cavitt <jonathan.cavitt@intel.com>
Wed, 4 Feb 2026 16:19:46 +0000 (16:19 +0000)
committerJani Nikula <jani.nikula@intel.com>
Tue, 17 Mar 2026 09:27:14 +0000 (11:27 +0200)
commit1cabff0d18733f1f33bd6ab0505cbec430834469
tree1f485821bad2218929172951cec798994b2f8ab1
parent33978364a2f3fc2989751bdabcaea0ec7e8d1ae8
drm/i915/gvt: Swap read and write checks

The function intel_gvt_i2c_handle_aux_ch_write currently does not
support the DP_AUX_I2C_WRITE operation.  Notably, we check if
op & 0x1 == DP_AUX_I2C_WRITE (one), and if it does not, assert that
op & 0x1 == DP_AUX_I2C_READ (zero).  This is unnecessary because if
op & 0x1 != 1, then op & 0x1 == 0.  But beyond that, it probably makes
more sense to check for the condition that is implemented, rather than
check for the condition that is not.

Swap the conditions.  We can also get rid of the unnecessary drm_WARN_ON
while we're here.

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20260204161945.8127-2-jonathan.cavitt@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/gvt/edid.c