Skip to contentSkip to conversation

video : remove redundant error check

PATCH In review Daeseok Youn 2 participants 3 messages May 16, 2014 – Aug 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 video : remove redundant error check

It doesn't need to check "err" for printing info.
And also use pr_info instead of printk.

---
V2: removes unneeded lines for sending a patch

 drivers/video/fbdev/i810/i810_main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/video/fbdev/i810/i810_main.c +3 -4
index bb674e4..15cb397 100644
@@ -1910,13 +1910,12 @@ static void i810fb_find_init_mode(struct fb_info *info)
 
 	for (i = 0; i < par->ddc_num + 1; i++) {
 		err = i810_probe_i2c_connector(info, &par->edid, i);
-		if (!err)
+		if (!err) {
+			pr_info("i810fb_init_pci: DDC probe successful\n");
 			break;
+		}
 	}
 
-	if (!err)
-		printk("i810fb_init_pci: DDC probe successful\n");
-
 	fb_edid_to_monspecs(par->edid, specs);
 
 	if (specs->modedb = NULL)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 22 lines · Daeseok Youn

It doesn't need to check "err" for printing info.
And also use pr_info instead of printk.

---
V2: removes unneeded lines for sending a patch

 drivers/video/fbdev/i810/i810_main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/video/fbdev/i810/i810_main.c +2 -1
index bb674e4..15cb397 100644
@@ -1910,13 +1910,12 @@ static void i810fb_find_init_mode(struct fb_info *info)
 
 	for (i = 0; i < par->ddc_num + 1; i++) {
 		err = i810_probe_i2c_connector(info, &par->edid, i);
-		if (!err)
+		if (!err) {
+			pr_info("i810fb_init_pci: DDC probe successful\n");

drivers/video/fbdev/i810/i810_main.c static void i810fb_find_init_mode(struct fb_info *info) · line 1921

Quoted 10 lines
drivers/video/fbdev/i810/i810_main.c +1 -3
 			break;
+		}
 	}
 
-	if (!err)
-		printk("i810fb_init_pci: DDC probe successful\n");
-
 	fb_edid_to_monspecs(par->edid, specs);
 
 	if (specs->modedb == NULL)

I don't know... I think I personally like more the original version. In fact, the whole print looks quite useless to me, or at least it should be a debug print.

Tomi

#2 lore raw

Hi,

2014-08-26 19:34 GMT+09:00 Tomi Valkeinen <[email protected]>:

Quoted 31 lines · Daeseok Youn
Quoted 30 lines

It doesn't need to check "err" for printing info.
And also use pr_info instead of printk.

---
V2: removes unneeded lines for sending a patch

 drivers/video/fbdev/i810/i810_main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/video/fbdev/i810/i810_main.c +3 -4
index bb674e4..15cb397 100644
@@ -1910,13 +1910,12 @@ static void i810fb_find_init_mode(struct fb_info *info)
 
      for (i = 0; i < par->ddc_num + 1; i++) {
              err = i810_probe_i2c_connector(info, &par->edid, i);
-             if (!err)
+             if (!err) {
+                     pr_info("i810fb_init_pci: DDC probe successful\n");
                      break;
+             }
      }
 
-     if (!err)
-             printk("i810fb_init_pci: DDC probe successful\n");
-
      fb_edid_to_monspecs(par->edid, specs);
 
Quoted 6 lines

drivers/video/fbdev/i810/i810_main.c static void i810fb_find_init_mode(struct fb_info *info) · line 1921

Quoted 2 lines
drivers/video/fbdev/i810/i810_main.c +0 -0
      if (specs->modedb = NULL)

I don't know... I think I personally like more the original version. In fact, the whole print looks quite useless to me, or at least it should be a debug print.

Yes. this patch doesn't need.

Thanks for review.

regards,
Daeseok Youn.

Quoted 4 lines

Tomi