]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/radeon: change function signature to pass full range
authorMathieu Malaterre <malat@debian.org>
Thu, 12 Apr 2018 19:33:33 +0000 (21:33 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Sep 2018 17:37:25 +0000 (12:37 -0500)
In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against
255 is done. Since it is always false, change the signature of this
function to use an `int` instead, which match the type used in caller:
`radeon_atom_hw_i2c_xfer`.

Fix the following warning triggered with W=1:

  CC [M]  drivers/gpu/drm/radeon/atombios_i2c.o
  drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’:
  drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   if (num > ATOM_MAX_HW_I2C_READ) {
           ^

Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/atombios_i2c.c

index 4157780585a0e8e89811e97349d99eb7bf026202..9022e9af11a0dbd8d83b03b3c301a65e5b30e329 100644 (file)
@@ -35,7 +35,7 @@
 
 static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
                                 u8 slave_addr, u8 flags,
-                                u8 *buf, u8 num)
+                                u8 *buf, int num)
 {
        struct drm_device *dev = chan->dev;
        struct radeon_device *rdev = dev->dev_private;