OSDN Git Service

drm/i915/gvt: Fix static checker warning on intel_gvt_i2c_handle_aux_ch_write()
authorZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 14 Nov 2016 02:32:58 +0000 (10:32 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 14 Nov 2016 10:06:44 +0000 (18:06 +0800)
Static checker gave warning on:

drivers/gpu/drm/i915/gvt/edid.c:506 intel_gvt_i2c_handle_aux_ch_write()
warn: odd binop '0x0 & 0xff'

We try to return ACK for I2C reply which is defined with 0. Remove
bit shift which caused misleading bit op.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/edid.c
drivers/gpu/drm/i915/gvt/edid.h

index 7e1da1c..bda85df 100644 (file)
@@ -502,8 +502,7 @@ void intel_gvt_i2c_handle_aux_ch_write(struct intel_vgpu *vgpu,
         * ACK of I2C_WRITE
         * returned byte if it is READ
         */
-
-       aux_data_for_write |= (GVT_AUX_I2C_REPLY_ACK & 0xff) << 24;
+       aux_data_for_write |= GVT_AUX_I2C_REPLY_ACK << 24;
        vgpu_vreg(vgpu, offset + 4) = aux_data_for_write;
 }
 
index de366b1..f6dfc8b 100644 (file)
@@ -44,7 +44,7 @@
 #define GVT_AUX_I2C_READ                       0x1
 #define GVT_AUX_I2C_STATUS                     0x2
 #define GVT_AUX_I2C_MOT                                0x4
-#define GVT_AUX_I2C_REPLY_ACK                  (0x0 << 6)
+#define GVT_AUX_I2C_REPLY_ACK                  0x0
 
 struct intel_vgpu_edid_data {
        bool data_valid;