summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/atombios_i2c.c
diff options
context:
space:
mode:
authorPan Zhang <zhangpan26@huawei.com>2019-12-18 11:50:08 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-12-18 16:09:13 -0500
commitd012ea925d6110f2bd4a9b398f87ef1a76c649c5 (patch)
tree841ff74142f3c44d007ba3dfcf354e69b100b59f /drivers/gpu/drm/radeon/atombios_i2c.c
parent719423f670796bb5d2e2894176033a493f684d8b (diff)
downloadlinux-d012ea925d6110f2bd4a9b398f87ef1a76c649c5.tar.bz2
gpu: drm: dead code elimination
this set adds support for removal of gpu drm dead code. patch3 is similar with patch 1: `num` is a data of u8 type and ATOM_MAX_HW_I2C_READ == 255, so there is a impossible condition '(num > 255) => (0-255 > 255)'. Signed-off-by: Pan Zhang <zhangpan26@huawei.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_i2c.c')
-rw-r--r--drivers/gpu/drm/radeon/atombios_i2c.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c
index a570ce40af19..ab4d21072191 100644
--- a/drivers/gpu/drm/radeon/atombios_i2c.c
+++ b/drivers/gpu/drm/radeon/atombios_i2c.c
@@ -68,11 +68,6 @@ static int radeon_process_i2c_ch(struct radeon_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;
}