From: Arnd Bergmann <arnd@kernel.org> To: Tomi Valkeinen <tomba@kernel.org>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch> Cc: Arnd Bergmann <arnd@arndb.de>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Jyri Sarha <jsarha@ti.com>, Tony Lindgren <tony@atomide.com>, Dinghao Liu <dinghao.liu@zju.edu.cn>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/omap: fix misleading indentation in pixinc() Date: Mon, 22 Mar 2021 17:41:57 +0100 [thread overview] Message-ID: <20210322164203.827324-1-arnd@kernel.org> (raw) From: Arnd Bergmann <arnd@arndb.de> 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: c6eee968d40d ("OMAPDSS: remove compiler warnings when CONFIG_BUG=n") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/omapdrm/dss/dispc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index f4cbef8ccace..5619420cc2cc 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2090,9 +2090,8 @@ static s32 pixinc(int pixels, u8 ps) return 1 + (pixels - 1) * ps; else if (pixels < 0) return 1 - (-pixels + 1) * ps; - else - BUG(); - return 0; + + BUG(); } static void calc_offset(u16 screen_width, u16 width, -- 2.29.2
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org> To: Tomi Valkeinen <tomba@kernel.org>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch> Cc: Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jyri Sarha <jsarha@ti.com>, Dinghao Liu <dinghao.liu@zju.edu.cn>, Laurent Pinchart <laurent.pinchart@ideasonboard.com> Subject: [PATCH] drm/omap: fix misleading indentation in pixinc() Date: Mon, 22 Mar 2021 17:41:57 +0100 [thread overview] Message-ID: <20210322164203.827324-1-arnd@kernel.org> (raw) From: Arnd Bergmann <arnd@arndb.de> 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: c6eee968d40d ("OMAPDSS: remove compiler warnings when CONFIG_BUG=n") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/gpu/drm/omapdrm/dss/dispc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index f4cbef8ccace..5619420cc2cc 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -2090,9 +2090,8 @@ static s32 pixinc(int pixels, u8 ps) return 1 + (pixels - 1) * ps; else if (pixels < 0) return 1 - (-pixels + 1) * ps; - else - BUG(); - return 0; + + BUG(); } static void calc_offset(u16 screen_width, u16 width, -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2021-03-22 16:42 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-22 16:41 Arnd Bergmann [this message] 2021-03-22 16:41 ` [PATCH] drm/omap: fix misleading indentation in pixinc() Arnd Bergmann 2021-03-26 7:21 ` Tomi Valkeinen 2021-03-26 7:21 ` Tomi Valkeinen
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210322164203.827324-1-arnd@kernel.org \ --to=arnd@kernel.org \ --cc=airlied@linux.ie \ --cc=arnd@arndb.de \ --cc=daniel@ffwll.ch \ --cc=dinghao.liu@zju.edu.cn \ --cc=dri-devel@lists.freedesktop.org \ --cc=jsarha@ti.com \ --cc=laurent.pinchart@ideasonboard.com \ --cc=linux-kernel@vger.kernel.org \ --cc=tomba@kernel.org \ --cc=tony@atomide.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.