From: "Javier M. Mellid" <jmunhoz@igalia.com>
To: gregkh@linuxfoundation.org, gewang@siliconmotion.com,
boyod.yang@siliconmotion.com.cn
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
"Javier M. Mellid" <jmunhoz@igalia.com>
Subject: [PATCH 4/4] staging: sm7xxfb: code cleanup on smtcfb_setmode
Date: Tue, 26 Jun 2012 06:00:17 +0200 [thread overview]
Message-ID: <1340683217-7986-5-git-send-email-jmunhoz@igalia.com> (raw)
In-Reply-To: <1340683217-7986-1-git-send-email-jmunhoz@igalia.com>
From: "Javier M. Mellid" <jmunhoz@igalia.com>
Code cleanup on smtcfb_setmode.
Tested with SM712.
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
---
drivers/staging/sm7xxfb/sm7xxfb.c | 64 +++++++++++++++++--------------------
1 file changed, 29 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 40e8e0d..08098c6 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -557,55 +557,49 @@ void smtcfb_setmode(struct smtcfb_info *sfb)
{
switch (sfb->fb.var.bits_per_pixel) {
case 32:
- sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
- sfb->fb.fix.line_length = sfb->fb.var.xres * 4;
- sfb->fb.var.red.length = 8;
+ sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
+ sfb->fb.fix.line_length = sfb->fb.var.xres * 4;
+ sfb->fb.var.red.length = 8;
sfb->fb.var.green.length = 8;
- sfb->fb.var.blue.length = 8;
- sfb->fb.var.red.offset = 16;
+ sfb->fb.var.blue.length = 8;
+ sfb->fb.var.red.offset = 16;
sfb->fb.var.green.offset = 8;
- sfb->fb.var.blue.offset = 0;
-
- break;
- case 8:
- sfb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
- sfb->fb.fix.line_length = sfb->fb.var.xres;
- sfb->fb.var.red.offset = 5;
- sfb->fb.var.red.length = 3;
- sfb->fb.var.green.offset = 2;
- sfb->fb.var.green.length = 3;
- sfb->fb.var.blue.offset = 0;
- sfb->fb.var.blue.length = 2;
+ sfb->fb.var.blue.offset = 0;
break;
case 24:
- sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
- sfb->fb.fix.line_length = sfb->fb.var.xres * 3;
- sfb->fb.var.red.length = 8;
+ sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
+ sfb->fb.fix.line_length = sfb->fb.var.xres * 3;
+ sfb->fb.var.red.length = 8;
sfb->fb.var.green.length = 8;
- sfb->fb.var.blue.length = 8;
-
- sfb->fb.var.red.offset = 16;
+ sfb->fb.var.blue.length = 8;
+ sfb->fb.var.red.offset = 16;
sfb->fb.var.green.offset = 8;
- sfb->fb.var.blue.offset = 0;
-
+ sfb->fb.var.blue.offset = 0;
+ break;
+ case 8:
+ sfb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
+ sfb->fb.fix.line_length = sfb->fb.var.xres;
+ sfb->fb.var.red.length = 3;
+ sfb->fb.var.green.length = 3;
+ sfb->fb.var.blue.length = 2;
+ sfb->fb.var.red.offset = 5;
+ sfb->fb.var.green.offset = 2;
+ sfb->fb.var.blue.offset = 0;
break;
case 16:
default:
- sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
- sfb->fb.fix.line_length = sfb->fb.var.xres * 2;
-
- sfb->fb.var.red.length = 5;
+ sfb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
+ sfb->fb.fix.line_length = sfb->fb.var.xres * 2;
+ sfb->fb.var.red.length = 5;
sfb->fb.var.green.length = 6;
- sfb->fb.var.blue.length = 5;
-
- sfb->fb.var.red.offset = 11;
+ sfb->fb.var.blue.length = 5;
+ sfb->fb.var.red.offset = 11;
sfb->fb.var.green.offset = 5;
- sfb->fb.var.blue.offset = 0;
-
+ sfb->fb.var.blue.offset = 0;
break;
}
- sfb->width = sfb->fb.var.xres;
+ sfb->width = sfb->fb.var.xres;
sfb->height = sfb->fb.var.yres;
sfb->hz = 60;
smtc_set_timing(sfb);
--
1.7.10
prev parent reply other threads:[~2012-06-26 4:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 4:00 [PATCH 0/4] staging: sm7xxfb: code improvements and cleanup Javier M. Mellid
2012-06-26 4:00 ` [PATCH 1/4] staging: sm7xxfb: dead code removal Javier M. Mellid
2012-06-26 4:00 ` [PATCH 2/4] " Javier M. Mellid
2012-06-26 4:00 ` [PATCH 3/4] staging: sm7xxfb: delete unnecessary color map allocation Javier M. Mellid
2012-06-26 4:00 ` Javier M. Mellid [this message]
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=1340683217-7986-5-git-send-email-jmunhoz@igalia.com \
--to=jmunhoz@igalia.com \
--cc=boyod.yang@siliconmotion.com.cn \
--cc=devel@driverdev.osuosl.org \
--cc=gewang@siliconmotion.com \
--cc=gregkh@linuxfoundation.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
all inboxes | Powered by JetHome®