From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Dave Airlie <airlied@redhat.com>, David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] gpu: drm: mgag200: remove unnecessary variable in mga_crtc_mode_set
Date: Thu, 15 Jun 2017 11:27:40 -0500 [thread overview]
Message-ID: <20170615162740.GA19088@embeddedgus> (raw)
Remove unnecessary variable _misc_ and refactor the code.
A value is assigned to variable _misc_ at lines 1002 and 1004
and then overwritten at line 1127, just before it can be used.
Besides, this variable is only being used as an argument when
calling macro WREG8() and, it is not implied in any other
operation.
Addresses-Coverity-ID: 1397681
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/gpu/drm/mgag200/mgag200_mode.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index adb411a..960e43b 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -923,7 +923,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,
int pitch;
int option = 0, option2 = 0;
int i;
- unsigned char misc = 0;
unsigned char ext_vga[6];
u8 bppshift;
@@ -998,11 +997,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,
break;
}
- if (mode->flags & DRM_MODE_FLAG_NHSYNC)
- misc |= 0x40;
- if (mode->flags & DRM_MODE_FLAG_NVSYNC)
- misc |= 0x80;
-
for (i = 0; i < sizeof(dacvalue); i++) {
if ((i <= 0x17) ||
@@ -1124,8 +1118,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,
ext_vga[1] |= 0x88;
/* Set pixel clocks */
- misc = 0x2d;
- WREG8(MGA_MISC_OUT, misc);
+ WREG8(MGA_MISC_OUT, 0x2d);
mga_crtc_set_plls(mdev, mode->clock);
@@ -1145,9 +1138,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc,
WREG_ECRT(0, ext_vga[0]);
/* Enable mga pixel clock */
- misc = 0x2d;
-
- WREG8(MGA_MISC_OUT, misc);
+ WREG8(MGA_MISC_OUT, 0x2d);
if (adjusted_mode)
memcpy(&mdev->mode, mode, sizeof(struct drm_display_mode));
--
2.5.0
reply other threads:[~2017-06-15 16:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170615162740.GA19088@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.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 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).