From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olof Johansson Subject: Re: [PATCH] soc: rockchip: work around clang warning Date: Wed, 3 Jul 2019 19:20:43 -0700 Message-ID: <20190704022043.gwcwasi6jni2qctm@localhost> References: <20190703153112.2767411-1-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190703153112.2767411-1-arnd@arndb.de> Sender: linux-kernel-owner@vger.kernel.org To: Arnd Bergmann Cc: Heiko Stuebner , arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com List-Id: linux-rockchip.vger.kernel.org On Wed, Jul 03, 2019 at 05:30:59PM +0200, Arnd Bergmann wrote: > clang emits a warning about a negative shift count for an > unused part of a conditional constant expression: > > drivers/soc/rockchip/pm_domains.c:795:21: error: shift count is negative [-Werror,-Wshift-count-negative] > [RK3328_PD_VIO] = DOMAIN_RK3328(-1, 8, 8, false), > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/soc/rockchip/pm_domains.c:129:2: note: expanded from macro 'DOMAIN_RK3328' > DOMAIN_M(pwr, pwr, req, (req) + 10, req, wakeup) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/soc/rockchip/pm_domains.c:105:33: note: expanded from macro 'DOMAIN_M' > .status_mask = (status >= 0) ? BIT(status) : 0, \ > ^~~~~~~~~~~ > include/linux/bits.h:6:24: note: expanded from macro 'BIT' > > This is a bug in clang that will be fixed in the future, but in order > to build cleanly with clang-8, it would be helpful to shut up this > warning. This file is the only instance reported by kernelci at the > moment. > > The best solution I could come up with is to move the BIT() usage > out of the macro into the instantiation, so we can avoid using > BIT(-1). > > Link: https://bugs.llvm.org/show_bug.cgi?id=38789 > Signed-off-by: Arnd Bergmann Thanks, queued under arm/drivers now. -Olof