Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp22917pxb; Fri, 15 Jan 2021 06:51:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH4x2zyGIEYnw1ndJTSRtNn5x8VCL3X1EYhw1aNPG5m/K76eXB94va4zbagi1o/vMrQoTY X-Received: by 2002:a17:906:3711:: with SMTP id d17mr8906869ejc.121.1610722264831; Fri, 15 Jan 2021 06:51:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610722264; cv=none; d=google.com; s=arc-20160816; b=wKdbCXvCZjJNWQz8D31420QaY8krMAm1SiqsyccxqRfupUMOfepajsSCPNRIpl2uO6 /ddJnKPSELFxJeB7du854rK4kU8yrDxAmiRutypK4EsIv9QCUy2xuMmT6dBoVNGaYrSg jGJkEc2XdHZmM56kLQlkojrXbat0SO29KZsP1PUMPsdrnpsZbXAwEnN7ACsomuOKphoq ha9b3jI4MlWnJbsO+b7bWIPdK5AvPkgK/GfhQZGcGqMQ+JPvMgBN4DJd46a61oDeMtED ATIneNHM4B9Y9Tv0PoGl58na2p84dgEuTzeXtlb8RoZG4A0tdvlSDjRcznp55fnRvbRw F1mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Y19JEjEja/UFqSCib9YerlVG5CSFZG8365YKlDMA9j0=; b=ZCPY2BLPzQ7tWbsqI7YpRxXTZsgYvxC6FSh3knuXr1i1DsGg5W0aGKQv5QJis5gnSv gJ0gTry2sFbhhLjSp+s1XUeosx6+jtQD5E6oPgL/hKQm7iQro9ZICW2Wsr8jKkUaGBvy m5ZGTUalhY5sDOzo8iKnicnNd3/5D+nP3TLjkJgQGOjMS+Wqe6+E1hiUViWyf4LfZf6g iv2AqfBB54GivplhpQ6iV1lJnq7iF2muBb/T4Hyf0YvuLks8/ghYB/8FK67pPvcaEly8 J2t6k7fmVZELI6CpK8CGXhB/Yf9Oq0HbHMi9YAtjqUNMP73lTFFLA3CqzX2OYHqRTuQo lGfA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn9si1395736edb.68.2021.01.15.06.50.41; Fri, 15 Jan 2021 06:51:04 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729568AbhAOOru (ORCPT + 99 others); Fri, 15 Jan 2021 09:47:50 -0500 Received: from elvis.franken.de ([193.175.24.41]:53927 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728559AbhAOOru (ORCPT ); Fri, 15 Jan 2021 09:47:50 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l0QNY-0006aU-01; Fri, 15 Jan 2021 15:47:08 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 1EE9FC057E; Fri, 15 Jan 2021 15:39:01 +0100 (CET) Date: Fri, 15 Jan 2021 15:39:01 +0100 From: Thomas Bogendoerfer To: Nathan Chancellor Cc: Nick Desaulniers , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, clang-built-linux@googlegroups.com, kernel test robot Subject: Re: [PATCH] MIPS: Compare __SYNC_loongson3_war against 0 Message-ID: <20210115143901.GB15166@alpha.franken.de> References: <20210114173416.738455-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210114173416.738455-1-natechancellor@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 10:34:16AM -0700, Nathan Chancellor wrote: > When building with clang when CONFIG_CPU_LOONGSON3_WORKAROUNDS is > enabled: > > In file included from lib/errseq.c:4: > In file included from ./include/linux/atomic.h:7: > ./arch/mips/include/asm/atomic.h:52:1: warning: converting the result of > '<<' to a boolean always evaluates to true > [-Wtautological-constant-compare] > ATOMIC_OPS(atomic64, s64) > ^ > ./arch/mips/include/asm/atomic.h:40:9: note: expanded from macro > 'ATOMIC_OPS' > return cmpxchg(&v->counter, o, n); > ^ > ./arch/mips/include/asm/cmpxchg.h:194:7: note: expanded from macro > 'cmpxchg' > if (!__SYNC_loongson3_war) > ^ > ./arch/mips/include/asm/sync.h:147:34: note: expanded from macro > '__SYNC_loongson3_war' > # define __SYNC_loongson3_war (1 << 31) > ^ > > While it is not wrong that the result of this shift is always true in a > boolean context, it is not a problem here. Regardless, the warning is > really noisy so rather than making the shift a boolean implicitly, use > it in an equality comparison so the shift is used as an integer value. > > Fixes: 4d1dbfe6cbec ("MIPS: atomic: Emit Loongson3 sync workarounds within asm") > Fixes: a91f2a1dba44 ("MIPS: cmpxchg: Omit redundant barriers for Loongson3") > Reported-by: kernel test robot > Signed-off-by: Nathan Chancellor > --- > arch/mips/include/asm/atomic.h | 2 +- > arch/mips/include/asm/cmpxchg.h | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) applied ti mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]