summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 11:17:08 +0100
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 11:18:24 +0100
commitc7e1eae537652330cec3fbf5f8f50000b2f24269 (patch)
treed1752293bb9899b6817f307ad6215abfe42751fe /drivers/video/omap2/omapfb
parentOMAPFB: fix error handling in omapfb_find_best_mode() (diff)
downloadlinux-c7e1eae537652330cec3fbf5f8f50000b2f24269.tar.xz
linux-c7e1eae537652330cec3fbf5f8f50000b2f24269.zip
OMAPFB: remove silly loop in fb2display()
fb2display() has a for loop which always returns at the first iteration. Replace the loop with a simple if. This removes the smatch warning: drivers/video/omap2/omapfb/omapfb.h:153 fb2display() info: loop could be replaced with if statement. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb')
-rw-r--r--drivers/video/omap2/omapfb/omapfb.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 71cd8bab31c0..2b5264475ed4 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -144,16 +144,16 @@ int omapfb_set_update_mode(struct fb_info *fbi, enum omapfb_update_mode mode);
static inline struct omap_dss_device *fb2display(struct fb_info *fbi)
{
struct omapfb_info *ofbi = FB2OFB(fbi);
- int i;
+ struct omap_overlay *ovl;
/* XXX: returns the display connected to first attached overlay */
- for (i = 0; i < ofbi->num_overlays; i++) {
- struct omap_overlay *ovl = ofbi->overlays[i];
- return ovl->get_device(ovl);
- }
+ if (ofbi->num_overlays == 0)
+ return NULL;
- return NULL;
+ ovl = ofbi->overlays[0];
+
+ return ovl->get_device(ovl);
}
static inline struct omapfb_display_data *get_display_data(