Commit 417fc612 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Tomi Valkeinen

drm/omap: fix misleading indentation in pixinc()

An old patch added a 'return' statement after each BUG() in this driver,
which was necessary at the time, but has become redundant after the BUG()
definition was updated to handle this properly.

gcc-11 now warns about one such instance, where the 'return' statement
was incorrectly indented:

drivers/gpu/drm/omapdrm/dss/dispc.c: In function ‘pixinc’:
drivers/gpu/drm/omapdrm/dss/dispc.c:2093:9: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
 2093 |         else
      |         ^~~~
drivers/gpu/drm/omapdrm/dss/dispc.c:2095:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
 2095 |                 return 0;
      |                 ^~~~~~

Address this by removing the return again and changing the BUG()
to be unconditional to make this more intuitive.

Fixes: c6eee968 ("OMAPDSS: remove compiler warnings when CONFIG_BUG=n")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210322164203.827324-1-arnd@kernel.org
parent ce517f18
...@@ -2090,9 +2090,8 @@ static s32 pixinc(int pixels, u8 ps) ...@@ -2090,9 +2090,8 @@ static s32 pixinc(int pixels, u8 ps)
return 1 + (pixels - 1) * ps; return 1 + (pixels - 1) * ps;
else if (pixels < 0) else if (pixels < 0)
return 1 - (-pixels + 1) * ps; return 1 - (-pixels + 1) * ps;
else
BUG(); BUG();
return 0;
} }
static void calc_offset(u16 screen_width, u16 width, static void calc_offset(u16 screen_width, u16 width,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment