video: vt8500lcdfb: remove unneeded continue

Started by Sudip Mukherjee on Jan 6, 2015 · 5 messages from 3 authors · Last reply Jan 13, 2015

Subsystems (3)

Maintainers (4)

STALE4321d

open the first message on its own page

  1. [PATCH] fbdev: geocode: remove unneeded NULL check
    Related patches
Message details and related content
continue is not needed at the end of a for loop

Signed-off-by: Sudip Mukherjee <redacted>
---
 drivers/video/fbdev/vt8500lcdfb.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index ffaf29e..6716bf5 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -115,7 +115,6 @@ static int vt8500lcd_set_par(struct fb_info *info)
 	for (i = 0; i < 8; i++) {
 		if (bpp_values[i] = info->var.bits_per_pixel) {
 			reg_bpp = i;
-			continue;
 		}
 	}
 
-- 
1.8.1.2

[PATCH] fbdev: geocode: remove unneeded NULL check

Message details and related content
the check for info is not required as we are checking it immediately
after gxfb_init_fbinfo() and lxfb_init_fbinfo() and returnig -ENOMEM
if it is NULL.

Signed-off-by: Sudip Mukherjee <redacted>
---
Hi Tomi,
This patch is similar to my last patch which you have already queued
for 3.20. if you can revert that then i can send you a single patch
with all these three changes together.

 drivers/video/fbdev/geode/gxfb_core.c | 6 ++----
 drivers/video/fbdev/geode/lxfb_core.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/geode/gxfb_core.c b/drivers/video/fbdev/geode/gxfb_core.c
index 1790f14..124d7c7 100644
--- a/drivers/video/fbdev/geode/gxfb_core.c
+++ b/drivers/video/fbdev/geode/gxfb_core.c
@@ -444,10 +444,8 @@ static int gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		pci_release_region(pdev, 1);
 	}
 
-	if (info) {
-		fb_dealloc_cmap(&info->cmap);
-		framebuffer_release(info);
-	}
+	fb_dealloc_cmap(&info->cmap);
+	framebuffer_release(info);
 	return ret;
 }
 
diff --git a/drivers/video/fbdev/geode/lxfb_core.c b/drivers/video/fbdev/geode/lxfb_core.c
index 9e1d19d..138da6c 100644
--- a/drivers/video/fbdev/geode/lxfb_core.c
+++ b/drivers/video/fbdev/geode/lxfb_core.c
@@ -577,10 +577,8 @@ err:
 		pci_release_region(pdev, 3);
 	}
 
-	if (info) {
-		fb_dealloc_cmap(&info->cmap);
-		framebuffer_release(info);
-	}
+	fb_dealloc_cmap(&info->cmap);
+	framebuffer_release(info);
 
 	return ret;
 }
-- 
1.8.1.2
Message details and related content
Hello.

On 01/06/2015 03:45 PM, Sudip Mukherjee wrote:
continue is not needed at the end of a for loop
Signed-off-by: Sudip Mukherjee <redacted>
---
  drivers/video/fbdev/vt8500lcdfb.c | 1 -
  1 file changed, 1 deletion(-)
quoted hunk
diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index ffaf29e..6716bf5 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -115,7 +115,6 @@ static int vt8500lcd_set_par(struct fb_info *info)
  	for (i = 0; i < 8; i++) {
  		if (bpp_values[i] = info->var.bits_per_pixel) {
  			reg_bpp = i;
-			continue;
  		}
    {} are not needed any more either. ;-)

[...]

WBR, Sergei
Message details and related content
On Tue, Jan 06, 2015 at 09:31:39PM +0300, Sergei Shtylyov wrote:
Hello.

On 01/06/2015 03:45 PM, Sudip Mukherjee wrote:
quoted
continue is not needed at the end of a for loop
quoted
Signed-off-by: Sudip Mukherjee <redacted>
---
 drivers/video/fbdev/vt8500lcdfb.c | 1 -
 1 file changed, 1 deletion(-)
quoted
diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index ffaf29e..6716bf5 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -115,7 +115,6 @@ static int vt8500lcd_set_par(struct fb_info *info)
 	for (i = 0; i < 8; i++) {
 		if (bpp_values[i] = info->var.bits_per_pixel) {
 			reg_bpp = i;
-			continue;
 		}
   {} are not needed any more either. ;-)
i have noticed that but thought that will be again a different type of change in a single patch.
but now it seems that this patch will introduce a new checkpatch warning, so i should have corrected that in it.
i will send a v2.

thanks
sudip
[...]

WBR, Sergei

Re: [PATCH] fbdev: geocode: remove unneeded NULL check

Message details and related content
On 06/01/15 14:45, Sudip Mukherjee wrote:
the check for info is not required as we are checking it immediately
after gxfb_init_fbinfo() and lxfb_init_fbinfo() and returnig -ENOMEM
if it is NULL.

Signed-off-by: Sudip Mukherjee <redacted>
---
Hi Tomi,
This patch is similar to my last patch which you have already queued
for 3.20. if you can revert that then i can send you a single patch
with all these three changes together.
No need for that, two separate patches is fine. So queued for 3.20.

 Tomi

Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help