Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5332521ybv; Tue, 11 Feb 2020 13:41:48 -0800 (PST) X-Google-Smtp-Source: APXvYqycMucHgzgG4DqiVUwf8tSqBhFy8Z9DdmGWu6ZSYnYN8bvg6oyNNjSH5BCKxQHcswiOZns0 X-Received: by 2002:aca:fcd4:: with SMTP id a203mr4020076oii.167.1581457308544; Tue, 11 Feb 2020 13:41:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457308; cv=none; d=google.com; s=arc-20160816; b=rpFn6Q3ggOZI+voFmG5EC3rLwEQz63b1kd3jQGXfzUH+EgAotKHxJUVbnT3nZixg+g Vd6QT4h42ToBOTf2TXBn8GKiMrXH2K/md86+wwci/CZ7v1Q5JUMoG+0O05H69iHOpwg5 zuIfjMuAunksT33oQK3h75BbC3d7gcFd4ob5WHNnf8otVT1cingTFCRELyo8Q4yMuXLq VsBAXL40PBfXh53VRHmrkUnKGEU47AyjRKnvQYw+qsDCZiioVgNaHh7vvNA/IhcVOAzC LtdweXXKP//7/Rn1AkQzc+bw2LV4TynMVeSaqtbPjjov08Jq2L8+e+De/S7AzByIZvzt eLwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8xXHirnYMsfW42qWffCZKCgeTYoQTR/f/eFrssIvcBc=; b=qdz/XKAey5j5mRc0+fL3U9c9An+Boct9gBW+nZaq/uClyF9NRA3AtO7xiDnVJbBeqJ P1XfoluSCh00KE8xixRGLgw1qO5QW6jN6AzHD45tmtFgwj7IIMucWBWXsLHd+gg7mR00 8VejK5diRQoFK/cBqIQFIoYLIL3NQRFtvkiwlWFNQfkL6ofMeRtfK4Tn0EiIJvzzUqi9 mUmPBDfNWTPt+Ixu5RMh9TT/dK/f1C8H919a89jZl3vQcR8WyqyWNVevNVwhZQWGZr27 VcFXW+U4B9Yg28ARQMb+w0S3z1vcal/U8iaPVAEhjE1aSLTEIi44+8DjCyQLJzfKW9sp XFTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S3vxb9w3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c130si2110961oib.182.2020.02.11.13.41.36; Tue, 11 Feb 2020 13:41:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S3vxb9w3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731081AbgBKU0n (ORCPT + 99 others); Tue, 11 Feb 2020 15:26:43 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:33027 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbgBKU0n (ORCPT ); Tue, 11 Feb 2020 15:26:43 -0500 Received: by mail-oi1-f193.google.com with SMTP id q81so14139748oig.0; Tue, 11 Feb 2020 12:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8xXHirnYMsfW42qWffCZKCgeTYoQTR/f/eFrssIvcBc=; b=S3vxb9w3RWHDDEzilj4NQtbOUARTaH1lr+ujyEc2cUA4GRiqYAZz+pZX7j7X1TijVP aS5OKS/lNuJ4cLs6ntKVetezUVStwUoZW85DrzOMr4WCRRViu/bfQjPjLK6pVtko3xz9 LitC/zBWxG0mvqvUHY0TLMpzpuPJEZarQpBdE9hdLYBvYD60KoSch9BY/BUBtifH7PJb o4soU9961YGI2+DTu2Onfeiwjh5vzuJgpxMwgp3jd+obzcSUaaaLt2y8D0Ehq3lyuRd8 9b9zgIeA4sN9qNQ/RhFgL/+w0WEeKOl8keMif/a/IT3EWC7kAFtM31ZojwMpez7gTvM7 6txw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8xXHirnYMsfW42qWffCZKCgeTYoQTR/f/eFrssIvcBc=; b=ZgMm1heamQyFs28/zEFiGHXQXGRT4QxWxqLqTpyJrOh8gaLBfR1OK/pXdFxkW4LTPA qUwFe6o9F5cjF61pyLpL0g7fVlv9PBsYctiBhm9HXm3bxUmjpIMzeoRahFdnBVfkZ7D7 A1FYI/QrohwVNrsH6ys4gMXbYRbgyall57FOrHfbqtIQjG0aH3YAniWkDNVY9a6uMw5+ WpA9WU5z/wwSvpujpsZ2ZmWu43rsJDuFMilAnEcpWbAJmo1HVQQsqQMsIFy8QwCkRAdo pZWgpDL1n5NONcJloZovX1Bf+wD+9gVxipPOYH5i+aVbv+Rs6hfcVDxWkLcimrdDMTRe VlhQ== X-Gm-Message-State: APjAAAV7yOG9Ze81QunG1xNsMD60/oRevR3PDqbB8EMnvDoEJzye6dhR FaLAYGbDuxeiOQDbkyniVDwlZNYcZtM= X-Received: by 2002:aca:cf12:: with SMTP id f18mr4119986oig.81.1581452802362; Tue, 11 Feb 2020 12:26:42 -0800 (PST) Received: from ubuntu-m2-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 17sm1567260oty.48.2020.02.11.12.26.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Feb 2020 12:26:41 -0800 (PST) Date: Tue, 11 Feb 2020 13:26:40 -0700 From: Nathan Chancellor To: Vasily Gorbik Cc: Christian Borntraeger , Heiko Carstens , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: -Wtautological-constant-compare in arch/s390/include/asm/page.h Message-ID: <20200211202640.GA12483@ubuntu-m2-xlarge-x86> References: <20200208125714.GA9164@ubuntu-x2-xlarge-x86> <1f54ae4c-8748-496b-0833-80749d8d4f6c@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 02:01:29PM +0100, Vasily Gorbik wrote: > On Mon, Feb 10, 2020 at 08:55:46AM +0100, Christian Borntraeger wrote: > > > > > > On 08.02.20 13:57, Nathan Chancellor wrote: > > > Hi all, > > > > > > We noticed that you all added support for building s390 with clang, > > > which is great! I have noticed a few warnings for which I will send > > > patches but this one has me stumped. > > > > > > In file included from ../lib/crypto/sha256.c:16: > > > In file included from ../include/linux/module.h:13: > > > In file included from ../include/linux/stat.h:19: > > > In file included from ../include/linux/time.h:6: > > > In file included from ../include/linux/seqlock.h:36: > > > In file included from ../include/linux/spinlock.h:51: > > > In file included from ../include/linux/preempt.h:78: > > > In file included from ../arch/s390/include/asm/preempt.h:6: > > > In file included from ../include/linux/thread_info.h:38: > > > In file included from ../arch/s390/include/asm/thread_info.h:26: > > > ../arch/s390/include/asm/page.h:45:6: warning: converting the result of '<<' to a boolean always evaluates to false [-Wtautological-constant-compare] > > > if (PAGE_DEFAULT_KEY) > > > ^ > > > ../arch/s390/include/asm/page.h:23:44: note: expanded from macro 'PAGE_DEFAULT_KEY' > > > #define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) > > > ^ > > > 1 warning generated. > > This warning only shows up for the decompressor code and purgatory which > have separate set of build flags not derived from top level KBUILD_CFLAGS. > For the rest of the code this warning is suppressed by: > Makefile: > 740 ifdef CONFIG_CC_IS_CLANG > ... > 744 # Quiet clang warning: comparison of unsigned expression < 0 is always false > 745 KBUILD_CFLAGS += -Wno-tautological-compare > > At the same time both decompressor and purgatory Makefiles include > CLANG_FLAGS into their CFLAGS. And this -Wno-tautological-compare is > clang specific. So I believe this option belongs to CLANG_FLAGS > rather than being included into KBUILD_CFLAGS under ifdef > CONFIG_CC_IS_CLANG. But this raises question about other clang > specific options inside that ifdef CONFIG_CC_IS_CLANG. Should they all > be made part of CLANG_FLAGS? Hi Vasily, I am trying to turn on -Wtautological-compare for the kernel as a whole, hence me trying to deal with this one now :) That flag controls a bunch of useful subwarnings that can point out potentially problematic code. I think that it would be worth adding warnings that we want disabled in all code to CLANG_FLAGS but as of right now, this is the only instance of this warning that I see within the s390 code so it is probably just worth silencing with an explicit comparison (!= 0). I will send a patch for this later. Cheers, Nathan