All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: airlied@redhat.com
Cc: tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Subject: [PATCH] drm/mgag200: Remove redundant assignment to status and clock
Date: Fri, 30 Apr 2021 17:22:32 +0800	[thread overview]
Message-ID: <1619774552-118157-1-git-send-email-jiapeng.chong@linux.alibaba.com> (raw)

Variable status is set to zero but this value is never read as
it is overwritten with a new value later on,clock is being assigned
a value from a calculation however the variable is never read,hence
these are redundant assignments that can be removed.

Clean up the following clang-analyzer warning:

drivers/gpu/drm/mgag200/mgag200_mode.c:284:3: warning: Value stored to
'clock' is never read [clang-analyzer-deadcode.DeadStores].

drivers/gpu/drm/mgag200/mgag200_mode.c:98:2: warning: Value stored to
'status' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index cece3e5..c4d5be8 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -95,7 +95,6 @@ static inline void mga_wait_vsync(struct mga_device *mdev)
 		status = RREG32(MGAREG_Status);
 	} while ((status & 0x08) && time_before(jiffies, timeout));
 	timeout = jiffies + HZ/10;
-	status = 0;
 	do {
 		status = RREG32(MGAREG_Status);
 	} while (!(status & 0x08) && time_before(jiffies, timeout));
@@ -280,8 +279,6 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
 
 		p |= (fvv << 4);
 		m |= 0x80;
-
-		clock = clock / 2;
 	}
 
 	if (delta > permitteddelta) {
-- 
1.8.3.1


WARNING: multiple messages have this Message-ID (diff)
From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
To: airlied@redhat.com
Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	tzimmermann@suse.de, airlied@linux.ie,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/mgag200: Remove redundant assignment to status and clock
Date: Fri, 30 Apr 2021 17:22:32 +0800	[thread overview]
Message-ID: <1619774552-118157-1-git-send-email-jiapeng.chong@linux.alibaba.com> (raw)

Variable status is set to zero but this value is never read as
it is overwritten with a new value later on,clock is being assigned
a value from a calculation however the variable is never read,hence
these are redundant assignments that can be removed.

Clean up the following clang-analyzer warning:

drivers/gpu/drm/mgag200/mgag200_mode.c:284:3: warning: Value stored to
'clock' is never read [clang-analyzer-deadcode.DeadStores].

drivers/gpu/drm/mgag200/mgag200_mode.c:98:2: warning: Value stored to
'status' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index cece3e5..c4d5be8 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -95,7 +95,6 @@ static inline void mga_wait_vsync(struct mga_device *mdev)
 		status = RREG32(MGAREG_Status);
 	} while ((status & 0x08) && time_before(jiffies, timeout));
 	timeout = jiffies + HZ/10;
-	status = 0;
 	do {
 		status = RREG32(MGAREG_Status);
 	} while (!(status & 0x08) && time_before(jiffies, timeout));
@@ -280,8 +279,6 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
 
 		p |= (fvv << 4);
 		m |= 0x80;
-
-		clock = clock / 2;
 	}
 
 	if (delta > permitteddelta) {
-- 
1.8.3.1

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

             reply	other threads:[~2021-04-30  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  9:22 Jiapeng Chong [this message]
2021-04-30  9:22 ` [PATCH] drm/mgag200: Remove redundant assignment to status and clock Jiapeng Chong

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=1619774552-118157-1-git-send-email-jiapeng.chong@linux.alibaba.com \
    --to=jiapeng.chong@linux.alibaba.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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.