mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 14:12:51 +00:00
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>
This commit is contained in:
parent
fa0c5e7129
commit
c7e1eae537
@ -144,18 +144,18 @@ 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];
|
||||
|
||||
if (ofbi->num_overlays == 0)
|
||||
return NULL;
|
||||
|
||||
ovl = ofbi->overlays[0];
|
||||
|
||||
return ovl->get_device(ovl);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct omapfb_display_data *get_display_data(
|
||||
struct omapfb2_device *fbdev, struct omap_dss_device *dssdev)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user