Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1088770pxf; Fri, 26 Mar 2021 00:25:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb0/1kJToVm1cqzAGFsHtsRwkAHRADOHsdo0SMqBg6GxRGUo19GIZtQ5+LKsL6+ivje6M4 X-Received: by 2002:aa7:c850:: with SMTP id g16mr13106862edt.324.1616743538916; Fri, 26 Mar 2021 00:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616743538; cv=none; d=google.com; s=arc-20160816; b=IfzADXNevKNmJ28fwj7j8b65mtPZo2myUhRN/k+b1MG2ia2MZhkZJgotTwM0SqSN0/ D9rVZBHTN7tWZjjqOjvi5K6+zfGM+Krpk1ICpi+OqI8QG17kZv6xSojPYv+k5f3kZeLR 4KCe0R2d8nCWLgpVQH3lEWH+VmaReGS9jnzR2JZLh9ny0KKvK6ZV/M5FOtqLRqxigqfL G+edeSOY8jsOamW9NeDn5pB/eMPGCGCCRf2ibvF1SPiaz8CaoiNBPGM+aq37MfN7/SIj Shn1h8MR1XbJ9fe30en5TzQfrzPvEbULlYipThRuQVz8dL5qWII9vf4UcgEH0u8T4RwQ 20wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=AUcB/QUVov9MvP5rQFXLWtfjcKklAGBwzEfrjj1C97g=; b=OmVlBk/z1Et6zBweuqhwyDjk5BgScxh8KCtLW4bxioO6SgMgPBuNM+S4igk6GMXdGt HmAi16TvcVnuBaMyEdSC14UHohL9VVSmtKzBBhStEpJUxBwHtZFg2EGuifCvCxO8te52 hgLbXrfLOd8xj4flPkdnyTJZJFxe4RPmjkANfwhLbVzoQQGIjDnDbdtHtTiyUKgbPuSx lNEwda7Z6kBcF2s2iSO9KU4HU1MvOwixvvPdkdEqO5A1nfnucaTd2HQOvxfrd1JO8JIK hJCZs9nnPLOz1VYdBTA++tZdovI51cCGJkDqvJPMMiWDfPLcFFoth7B+fvepv/IR3eVT snBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ebh89u+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si6155644edq.475.2021.03.26.00.25.14; Fri, 26 Mar 2021 00:25:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ebh89u+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhCZHWF (ORCPT + 99 others); Fri, 26 Mar 2021 03:22:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:40158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbhCZHVs (ORCPT ); Fri, 26 Mar 2021 03:21:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36E3F61A18; Fri, 26 Mar 2021 07:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616743308; bh=BGRR36ccL5GWDF9Q8BHWhizHme3WDeUjirfIggnlBuI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ebh89u+11fnx6NG2uVsb/Hj3RD4LGwa+KuDvP4sslHy+3DWXdhts5u9rSgJek1ag0 CQa3VMlMqVABdlLTwPjyL+38ovR1eZFQIVN00+te9FQqzpN9n4pOzjqAadOeKiumYm gK5wYLOIXsXYWkyRsU9PxIhc1cmIQqv8zZ/XZN2XiBGK1ISsMIuy2JWsNEL9yuXbvC v7fPT1v3aVJJj/+QqBnQrQpDAr4zoVAsW2Lc0tP7zGqRgKg6gyYEBPedzSH35N6D7Z dV3JFwr1hLLkXAMTkRwuvuR1A0RHYP1U7REKhpRQyY2z3CBwVNS2abdZWdkhUG0RNd pttvD1/2zejXA== Subject: Re: [PATCH] drm/omap: fix misleading indentation in pixinc() To: Arnd Bergmann , David Airlie , Daniel Vetter Cc: Arnd Bergmann , Laurent Pinchart , Jyri Sarha , Tony Lindgren , Dinghao Liu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20210322164203.827324-1-arnd@kernel.org> From: Tomi Valkeinen Message-ID: <1c385d8d-224b-3484-e539-d791512dd88f@kernel.org> Date: Fri, 26 Mar 2021 09:21:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210322164203.827324-1-arnd@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/03/2021 18:41, Arnd Bergmann wrote: > 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, Thanks, I'll pick this up. Tomi