Commit cf5d3273 authored by Rehas Sachdeva's avatar Rehas Sachdeva Committed by Greg Kroah-Hartman

staging: xgifb: Remove unused variable and if statement

Setting the variable 'refresh_rate = 60;' has no use to the rest of the
function. Hence the if statement setting it and the variable itself can be
removed. This was detected using the following Coccinelle semantic patch:

@@
type T;
identifier i;
constant C;
@@
(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)
Signed-off-by: default avatarRehas Sachdeva <aquannie@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3adc4aae
...@@ -1224,7 +1224,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -1224,7 +1224,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
unsigned int vtotal = 0; unsigned int vtotal = 0;
unsigned int drate = 0, hrate = 0; unsigned int drate = 0, hrate = 0;
int found_mode = 0; int found_mode = 0;
int refresh_rate, search_idx; int search_idx;
if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) { if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) {
vtotal = var->upper_margin + var->yres + var->lower_margin vtotal = var->upper_margin + var->yres + var->lower_margin
...@@ -1260,10 +1260,6 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -1260,10 +1260,6 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
xgifb_info->refresh_rate = 60; xgifb_info->refresh_rate = 60;
} }
/* Calculation wrong for 1024x600 - force it to 60Hz */
if ((var->xres == 1024) && (var->yres == 600))
refresh_rate = 60;
search_idx = 0; search_idx = 0;
while ((XGIbios_mode[search_idx].mode_no != 0) && while ((XGIbios_mode[search_idx].mode_no != 0) &&
(XGIbios_mode[search_idx].xres <= var->xres)) { (XGIbios_mode[search_idx].xres <= var->xres)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment