* [PATCH 1/3] gpu: drm: dead code elimination
@ 2019-12-18 3:49 Pan Zhang
2019-12-18 20:11 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: Pan Zhang @ 2019-12-18 3:49 UTC (permalink / raw)
To: zhangpan26, hushiyuan, alexander.deucher, christian.koenig,
David1.Zhou, airlied, daniel, sam
Cc: amd-gfx, dri-devel, linux-kernel
this set adds support for removal of gpu drm dead code.
patch1:
`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>
---
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 980c363..b4cc7c5 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
@@ -76,11 +76,6 @@ static int amdgpu_atombios_i2c_process_i2c_ch(struct amdgpu_i2c_chan *chan,
}
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.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/3] gpu: drm: dead code elimination
2019-12-18 3:49 [PATCH 1/3] gpu: drm: dead code elimination Pan Zhang
@ 2019-12-18 20:11 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-12-18 20:11 UTC (permalink / raw)
To: Pan Zhang
Cc: hushiyuan, Deucher, Alexander, Christian Koenig, Chunming Zhou,
Dave Airlie, Daniel Vetter, Sam Ravnborg,
Maling list - DRI developers, amd-gfx list, LKML
On Wed, Dec 18, 2019 at 3:13 AM Pan Zhang <zhangpan26@huawei.com> wrote:
>
> this set adds support for removal of gpu drm dead code.
>
> patch1:
> `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>
This change was already made by someone else.
Alex
> ---
> 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 980c363..b4cc7c5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
> +++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
> @@ -76,11 +76,6 @@ static int amdgpu_atombios_i2c_process_i2c_ch(struct amdgpu_i2c_chan *chan,
> }
> 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.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-18 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 3:49 [PATCH 1/3] gpu: drm: dead code elimination Pan Zhang
2019-12-18 20:11 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).