lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.4 024/100] drm/amdgpu: remove always false comparison in 'amdgpu_atombios_i2c_process_i2c_ch'
    Date
    From: yu kuai <yukuai3@huawei.com>

    [ Upstream commit 220ac8d1444054ade07ce14498fcda266410f90e ]

    Fixes gcc '-Wtype-limits' warning:

    drivers/gpu/drm/amd/amdgpu/atombios_i2c.c: In function
    ‘amdgpu_atombios_i2c_process_i2c_ch’:
    drivers/gpu/drm/amd/amdgpu/atombios_i2c.c:79:11: warning: comparison is
    always false due to limited range of data type [-Wtype-limits]

    'num' is 'u8', so it will never be greater than 'TOM_MAX_HW_I2C_READ',
    which is defined as 255. Therefore, the comparison can be removed.

    Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
    Signed-off-by: yu kuai <yukuai3@huawei.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/gpu/drm/amd/amdgpu/atombios_i2c.c | 5 -----
    1 file changed, 5 deletions(-)

    diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
    index 13cdb01e9b450..59fd674128540 100644
    --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
    +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
    @@ -68,11 +68,6 @@ static int amdgpu_atombios_i2c_process_i2c_ch(struct amdgpu_i2c_chan *chan,
    memcpy(&out, &buf[1], num);
    args.lpI2CDataOut = cpu_to_le16(out);
    } else {
    - if (num > ATOM_MAX_HW_I2C_READ) {
    - DRM_ERROR("hw i2c: tried to read too many bytes (%d vs 255)\n", num);
    - r = -EINVAL;
    - goto done;
    - }
    args.ucRegIndex = 0;
    args.lpI2CDataOut = 0;
    }
    --
    2.20.1
    \
     
     \ /
      Last update: 2020-02-14 17:35    [W:4.103 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site