drivers: video: fbcmap: remove the redundency and incorrect checkings
PATCH v2 1/1 drivers: video: fbcmap: remove the redundency and incorrect checkings
fb_set_cmap() already checks the parameters, so need remove the redundancy checking.
This redundancy checking is also incorrect, the related warning:
drivers/video/fbcmap.c:288:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
--- drivers/video/fbcmap.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/video/fbcmap.c +1 -6
@@ -285,13 +285,8 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) rc = -ENODEV ; goto out; } -if (cmap->start <0 || (!info->fbops->fb_setcolreg && - !info->fbops->fb_setcmap)) { - rc = -EINVAL ; - goto out1; - } + rc =fb_set_cmap (&umap, info); -out1:unlock_fb_info (info); out:fb_dealloc_cmap (&umap);
Signature · 1 line
1.7.7.6
Quoted 23 lines · Chen Gang
fb_set_cmap()already checks the parameters, so need remove the redundancy checking.This redundancy checking is also incorrect, the related warning:
drivers/video/fbcmap.c:288:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]Signed-off-by Chen Gang <[email protected]>--- drivers/video/fbcmap.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)drivers/video/fbcmap.c +0
-1@@ -285,13 +285,8 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) rc = -ENODEV ; goto out; } - if (cmap->start < 0 || (!info->fbops->fb_setcolreg &&
drivers/video/fbcmap.c int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) · line 292
Quoted 10 lines
drivers/video/fbcmap.c +1
-5- !info->fbops->fb_setcmap)) { - rc = -EINVAL ; - goto out1; - } + rc =fb_set_cmap (&umap, info); -out1:unlock_fb_info (info); out:fb_dealloc_cmap (&umap);
Thanks, queued this for 3.12.
Tomi
Quoted 28 lines · Tomi Valkeinen
Quoted 27 lines · Chen Gang
fb_set_cmap()already checks the parameters, so need remove the redundancy checking.This redundancy checking is also incorrect, the related warning:
drivers/video/fbcmap.c:288:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]Signed-off-by Chen Gang <[email protected]>--- drivers/video/fbcmap.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)drivers/video/fbcmap.c +1
-5@@ -285,13 +285,8 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) rc = -ENODEV ; goto out; } -if (cmap->start <0 || (!info->fbops->fb_setcolreg && - !info->fbops->fb_setcmap)) { - rc = -EINVAL ; - goto out1; - } +
Quoted 9 lines
drivers/video/fbcmap.c int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) · line 292
Quoted 6 lines
drivers/video/fbcmap.c +0
-1rc =fb_set_cmap (&umap, info); -out1:unlock_fb_info (info); out:fb_dealloc_cmap (&umap);Thanks, queued this for 3.12.
Thank you too.
Quoted 3 lines
Tomi
Signature · 1 line
Chen Gang