linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Huewe <peterhuewe@gmx.de>
To: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Miguel Gómez" <magomez@igalia.com>,
	"Aaro Koskinen" <aaro.koskinen@iki.fi>,
	"Peter Huewe" <peterhuewe@gmx.de>,
	"Sam Hansen" <solid.se7en@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 06/10] staging/xgifb: rewrite XGIfb_get_cmap_len
Date: Sun,  3 Feb 2013 22:54:35 +0100	[thread overview]
Message-ID: <1359928479-8484-6-git-send-email-peterhuewe@gmx.de> (raw)
In-Reply-To: <1359928479-8484-1-git-send-email-peterhuewe@gmx.de>

We don't need to use this switch-case here for a simple two case
if-else.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/staging/xgifb/XGI_main_26.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 106abc8..840b497 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1131,22 +1131,10 @@ static int XGIfb_release(struct fb_info *info, int user)
 	return 0;
 }
 
+/* similar to sisfb_get_cmap_len */
 static int XGIfb_get_cmap_len(const struct fb_var_screeninfo *var)
 {
-	int rc = 16;
-
-	switch (var->bits_per_pixel) {
-	case 8:
-		rc = 256;
-		break;
-	case 16:
-		rc = 16;
-		break;
-	case 32:
-		rc = 16;
-		break;
-	}
-	return rc;
+	return (var->bits_per_pixel == 8) ? 256 : 16;
 }
 
 static int XGIfb_setcolreg(unsigned regno, unsigned red, unsigned green,
-- 
1.7.8.6


  parent reply	other threads:[~2013-02-03 21:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03 21:54 [PATCH 01/10] staging/xgifb: Simplify XGI_GetRatePtrCRT2 Peter Huewe
2013-02-03 21:54 ` [PATCH 02/10] staging/xgifb: Remove always false comparisons Peter Huewe
2013-02-03 21:54 ` [PATCH 03/10] staging/xgifb: mttr must be (signed) int Peter Huewe
2013-02-03 21:54 ` [PATCH 04/10] staging/xgifb: Fix return of uninitialized variable Peter Huewe
2013-02-03 21:54 ` [PATCH 05/10] staging/xgifb: Simplify XGI_SetSeqRegs Peter Huewe
2013-02-03 21:54 ` Peter Huewe [this message]
2013-02-03 21:54 ` [PATCH 07/10] staging/xgifb: remove unnecessary temp variable in XGIfb_mode_rate_to_ddata Peter Huewe
2013-02-03 21:54 ` [PATCH 08/10] staging/xgifb: Remove unnecessary bitshifts in XGI_SetCRT1ModeRegs Peter Huewe
2013-02-04 12:59   ` Dan Carpenter
2013-02-04 18:25     ` H Hartley Sweeten
2013-02-03 21:54 ` [PATCH 09/10] staging/xgifb: Consolidate XGI_EnableChISLCD and XGI_DisableChISLCD Peter Huewe
2013-02-03 21:54 ` [PATCH 10/10] staging/xgifb: Simplify XGISetModeNew Peter Huewe
2013-02-04 19:37 ` [PATCH 01/10] staging/xgifb: Simplify XGI_GetRatePtrCRT2 Aaro Koskinen

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=1359928479-8484-6-git-send-email-peterhuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=aaro.koskinen@iki.fi \
    --cc=arnaud.patard@rtp-net.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magomez@igalia.com \
    --cc=solid.se7en@gmail.com \
    /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).