staging: xgifb: Rename local variable
PATCH v2 1/1 staging: xgifb: Rename local variable
As one of the global variables and a local variable share the same name, change the name of the local variable to avoid confusion.
---
Changes since v1:
* Changed the name of the variable to something more meaningful
drivers/staging/xgifb/XGI_main_26.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/xgifb/XGI_main_26.c +2 -2
@@ -1230,7 +1230,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)unsigned int vtotal =0 ;unsigned int drate =0 , hrate =0 ;int found_mode =0 ; -int refresh_rate, search_idx; +int local_refresh_rate, search_idx;if ((var->vmode &FB_VMODE_MASK ) ==FB_VMODE_NONINTERLACED ) { vtotal = var->upper_margin + var->yres + var->lower_margin
@@ -1268,7 +1268,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)/* Calculation wrong for 1024x600 - force it to 60Hz */ if ((var->xres ==1024 ) && (var->yres ==600 )) - refresh_rate =60 ; + local_refresh_rate =60 ; search_idx =0 ; while ((XGIbios_mode[search_idx].mode_no != 0) &&
Signature · 1 line
2.5.0
Quoted 25 lines · Janani Ravichandran
As one of the global variables and a local variable share the same name, change the name of the local variable to avoid confusion.
Signed-off-by Janani Ravichandran <[email protected]>---
Changes since v1:
* Changed the name of the variable to something more meaningfuldrivers/staging/xgifb/XGI_main_26.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/xgifb/XGI_main_26.c +1
-1@@ -1230,7 +1230,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)unsigned int vtotal =0 ;unsigned int drate =0 , hrate =0 ;int found_mode =0 ; -int refresh_rate, search_idx; +int local_refresh_rate, search_idx;if ((var->vmode &FB_VMODE_MASK ) ==FB_VMODE_NONINTERLACED ) { vtotal = var->upper_margin + var->yres + var->lower_margin
drivers/staging/xgifb/XGI_main_26.c static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) · line 1271
Quoted 5 lines
drivers/staging/xgifb/XGI_main_26.c +1
-1@@ -1268,7 +1268,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)/* Calculation wrong for 1024x600 - force it to 60Hz */ if ((var->xres ==1024 ) && (var->yres ==600 )) - refresh_rate =60 ; + local_refresh_rate =60 ;
So this variable is only initialized, but never used? If that is the case, then a better solution would be to drop it.
Or maybe it was not intended to introduce the local variable. You might want to see what you can find with git blame on the line that makes the local declaration.
julia
Quoted 13 lines
drivers/staging/xgifb/XGI_main_26.c +0
-0search_idx =0 ; while ((XGIbios_mode[search_idx].mode_no != 0) &&Signature · 8 lines
2.5.0 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160210033729.GA2677%40janani-Inspiron-3521. For more options, visit https://groups.google.com/d/optout.
Quoted 38 lines · Julia Lawall
Quoted 25 lines · Janani Ravichandran
As one of the global variables and a local variable share the same name, change the name of the local variable to avoid confusion.
Signed-off-by Janani Ravichandran <[email protected]>---
Changes since v1:
* Changed the name of the variable to something more meaningfuldrivers/staging/xgifb/XGI_main_26.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/xgifb/XGI_main_26.c +1
-1@@ -1230,7 +1230,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)unsigned int vtotal =0 ;unsigned int drate =0 , hrate =0 ;int found_mode =0 ; -int refresh_rate, search_idx; +int local_refresh_rate, search_idx;if ((var->vmode &FB_VMODE_MASK ) ==FB_VMODE_NONINTERLACED ) { vtotal = var->upper_margin + var->yres + var->lower_margindrivers/staging/xgifb/XGI_main_26.c static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) · line 1271
Quoted 5 lines
drivers/staging/xgifb/XGI_main_26.c +1
-1@@ -1268,7 +1268,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)/* Calculation wrong for 1024x600 - force it to 60Hz */ if ((var->xres ==1024 ) && (var->yres ==600 )) - refresh_rate =60 ; + local_refresh_rate =60 ;So this variable is only initialized, but never used? If that is the case, then a better solution would be to drop it.
Quoted 3 lines
Or maybe it was not intended to introduce the local variable. You might want to see what you can find with git blame on the line that makes the local declaration.
If you remember in the last round of Outreachy also we had a similar discussion, I will see if I can find out that thread.
regards
sudip
Quoted 5 lines
Quoted 4 lines
So this variable is only initialized, but never used? If that is the case, then a better solution would be to drop it.
I was in fact debating between dropping it and renaming it but decided on renaming it as I thought it might be used in the future, looking at the if() check and the comment above it. Not sure if this was a good idea.
Quoted 4 lines
Quoted 3 lines
Or maybe it was not intended to introduce the local variable. You might want to see what you can find with git blame on the line that makes the local declaration.
Sure, I will do that.
Quoted 3 lines
If you remember in the last round of Outreachy also we had a similar discussion, I will see if I can find out that thread.
I'd love to see it, Sudip.
Thanks,
Janani.
Quoted 4 lines
regards
sudip
Quoted 13 lines · Janani Ravichandran
Quoted 5 lines
Quoted 4 lines
So this variable is only initialized, but never used? If that is the case, then a better solution would be to drop it.
I was in fact debating between dropping it and renaming it but decided on renaming it as I thought it might be used in the future, looking at the
if()check and the comment above it. Not sure if this was a good idea.Quoted 4 lines
Quoted 3 lines
Or maybe it was not intended to introduce the local variable. You might want to see what you can find with git blame on the line that makes the local declaration.
Quoted 7 lines
Sure, I will do that.
Quoted 3 lines
If you remember in the last round of Outreachy also we had a similar discussion, I will see if I can find out that thread.
I'd love to see it, Sudip.
regards
sudip