Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pan Zhang and committed by
Alex Deucher
d012ea92 719423f6

-5
-5
drivers/gpu/drm/radeon/atombios_i2c.c
··· 68 68 memcpy(&out, &buf[1], num); 69 69 args.lpI2CDataOut = cpu_to_le16(out); 70 70 } else { 71 - if (num > ATOM_MAX_HW_I2C_READ) { 72 - DRM_ERROR("hw i2c: tried to read too many bytes (%d vs 255)\n", num); 73 - r = -EINVAL; 74 - goto done; 75 - } 76 71 args.ucRegIndex = 0; 77 72 args.lpI2CDataOut = 0; 78 73 }