All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pan Zhang <zhangpan26@huawei.com>
To: <zhangpan26@huawei.com>, <hushiyuan@huawei.com>,
	<alexander.deucher@amd.com>, <christian.koenig@amd.com>,
	<David1.Zhou@amd.com>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<sam@ravnborg.org>
Cc: <amd-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] gpu: drm: dead code elimination
Date: Wed, 18 Dec 2019 11:49:48 +0800	[thread overview]
Message-ID: <1576640988-14639-1-git-send-email-zhangpan26@huawei.com> (raw)

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


WARNING: multiple messages have this Message-ID (diff)
From: Pan Zhang <zhangpan26@huawei.com>
To: <zhangpan26@huawei.com>, <hushiyuan@huawei.com>,
	<alexander.deucher@amd.com>, <christian.koenig@amd.com>,
	<David1.Zhou@amd.com>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<sam@ravnborg.org>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] gpu: drm: dead code elimination
Date: Wed, 18 Dec 2019 11:49:48 +0800	[thread overview]
Message-ID: <1576640988-14639-1-git-send-email-zhangpan26@huawei.com> (raw)

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Pan Zhang <zhangpan26@huawei.com>
To: <zhangpan26@huawei.com>, <hushiyuan@huawei.com>,
	<alexander.deucher@amd.com>, <christian.koenig@amd.com>,
	<David1.Zhou@amd.com>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<sam@ravnborg.org>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] gpu: drm: dead code elimination
Date: Wed, 18 Dec 2019 11:49:48 +0800	[thread overview]
Message-ID: <1576640988-14639-1-git-send-email-zhangpan26@huawei.com> (raw)

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2019-12-18  3:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  3:49 Pan Zhang [this message]
2019-12-18  3:49 ` [PATCH 1/3] gpu: drm: dead code elimination Pan Zhang
2019-12-18  3:49 ` Pan Zhang
2019-12-18 20:11 ` Alex Deucher
2019-12-18 20:11   ` Alex Deucher
2019-12-18 20:11   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1576640988-14639-1-git-send-email-zhangpan26@huawei.com \
    --to=zhangpan26@huawei.com \
    --cc=David1.Zhou@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hushiyuan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.