Skip to content

Commit

Permalink
staging/xgifb: rewrite XGIfb_get_cmap_len
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Huewe authored and Greg Kroah-Hartman committed Feb 4, 2013
1 parent 76a5899 commit bae3170
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions drivers/staging/xgifb/XGI_main_26.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bae3170

Please sign in to comment.