Skip to contentSkip to conversation

drivers: video: fbcmap: remove the redundency and incorrect checkings

PATCH In review Chen Gang 2 participants 3 messages Aug 20, 2013 – Aug 30, 2013 Framebuffer layer

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

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
index 5c3960d..f89245b 100644
@@ -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
#1 lore raw
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]

---
 drivers/video/fbcmap.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/video/fbcmap.c +0 -1
index 5c3960d..f89245b 100644
@@ -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

author
#2 lore raw
In reply to Chen Gang
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]

---
 drivers/video/fbcmap.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/video/fbcmap.c +1 -5
index 5c3960d..f89245b 100644
@@ -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 -1
 	rc = 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