From patchwork Mon Mar 22 16:41:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12155579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AC35C433E0 for ; Mon, 22 Mar 2021 16:42:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6C9F6157F for ; Mon, 22 Mar 2021 16:42:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6C9F6157F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E26E6E52C; Mon, 22 Mar 2021 16:42:09 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id AFB176E52C for ; Mon, 22 Mar 2021 16:42:07 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9AEB161983; Mon, 22 Mar 2021 16:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616431327; bh=9xvqTNezw3tYuoVfeeADeGM3s9v4JWgUTmRGf4uQ2NU=; h=From:To:Cc:Subject:Date:From; b=effL3sJznDj8ualeXh5XCrDafKag1c2smDyLYgtFi/TZ/nhyq+qP6dzFvy6zU0uXJ YI+BBE7mnNAxmrU9dukG9Gx6vnYPWGd+GJCr8g8UiFalENeznr9qCd0/2H+hOO/rHN ZnmXT92X720doHPJh3OF2eUW6l8NWz1YDCZLRYPLsfrIBMEGcy/YmKiuxVZv2FPadm kYshsDZEnmPM+0VOoE6BRjTAsal86mIFHv+gh7f1/6hPRfSqKpwt1Ot2KfEID/pw+1 0N5DTaoT3xy7ZfhBogPXIM0BmhyPogSTNRGhogZ3LcSKOXvOlk0jzLTZ5lJfHCcFgl rANd6JpBL/4iw== From: Arnd Bergmann To: Tomi Valkeinen , David Airlie , Daniel Vetter Subject: [PATCH] drm/omap: fix misleading indentation in pixinc() Date: Mon, 22 Mar 2021 17:41:57 +0100 Message-Id: <20210322164203.827324-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Tony Lindgren , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jyri Sarha , Dinghao Liu , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann 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 --- 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,