Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp5158811pjo; Tue, 11 Feb 2020 05:05:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzYvvFC845Bfr6PkTPhmPZVXctO/w3fRG6NOj4USemxLvzgrVCryTR9tSoyGk40oNH4EVdw X-Received: by 2002:aca:5f85:: with SMTP id t127mr2836153oib.1.1581426326104; Tue, 11 Feb 2020 05:05:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581426326; cv=none; d=google.com; s=arc-20160816; b=hdB3db2DKqy8yMKbEs+bxnXzON6xEsoMm/kJY5unRiwnfFtJQ4J2/ilXYZlWgWhzpo aUDmxoM3+b5vaRed7pj9L6t3EI2SxHK174UmB7Q7wjc2k7MiFZ6pOcJ6WGYYKmIQvyHL B0Rp0s+jEpldTKAnL/zhsYKS+U1WOCtFTDaRwH+VSH7ikQlsmmMxS0KxfrhMGX6KiztK Jf+KE6wjK3mECjAIIw9xLdQVKmGYrO6mXVPQo7yWC8ApbqXQeW5ANzFfDy0+H3omvTQf UCGIpL8B+y8PZlYT2YeEv6l1iAyimOjulcTP95XIakdFlC/0l6CtbnCW2cJvB+Y1PKAi 2O7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=TcQnLjd0hiM9xY7dpbqwnEXQBnXTxLMVbY9V6yfCVYs=; b=g7d0l+VgvFrxr+Gjh343mfr1XLQKhmiPNFu3X9bCR31MOeJgT79Vw9+1PghZA9M17i 0Ty0tHU3PdvLhkmnViZRQ0ZoBOGbD6RL6idwwg7D2lGw4CMwVwrdTcwtY/zjMjDsoGGG pf0u4yO9VoQINIkOhpbtxXsIu2C+mkqPxkWAuixxEj/GZso8aV8qAg7Gyjp7WKSQ/lRZ EGm8d+LnQ9lf03c9UHFyn2JVURQDcsIHMXedd45pQoEhaUHzFriRoGTFsSWUDqFBT/zo ykyrgYc/N/ZWB769QGNHPjjhBhwsOSJGhBrNSord784L2jNbMPmYVTIMiFAAxWwBqJX4 00IQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h125si1613399oia.253.2020.02.11.05.04.59; Tue, 11 Feb 2020 05:05:26 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728836AbgBKNBj (ORCPT + 99 others); Tue, 11 Feb 2020 08:01:39 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:28382 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728475AbgBKNBj (ORCPT ); Tue, 11 Feb 2020 08:01:39 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01BD0Hml008486 for ; Tue, 11 Feb 2020 08:01:38 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y3pqfcvbu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 11 Feb 2020 08:01:38 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Feb 2020 13:01:36 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 11 Feb 2020 13:01:33 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01BD1VPJ53805174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Feb 2020 13:01:31 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7735D52054; Tue, 11 Feb 2020 13:01:31 +0000 (GMT) Received: from localhost (unknown [9.145.77.145]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 108C952051; Tue, 11 Feb 2020 13:01:31 +0000 (GMT) Date: Tue, 11 Feb 2020 14:01:29 +0100 From: Vasily Gorbik To: Nathan Chancellor 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 References: <20200208125714.GA9164@ubuntu-x2-xlarge-x86> <1f54ae4c-8748-496b-0833-80749d8d4f6c@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1f54ae4c-8748-496b-0833-80749d8d4f6c@de.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 20021113-0020-0000-0000-000003A925FE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20021113-0021-0000-0000-0000220105E5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-11_03:2020-02-10,2020-02-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1031 bulkscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=1 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002110100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > > > PAGE_DEFAULT_PAGE is always 0, meaning this function never does what it > > is supposed to. Is this intentional? It seems that commit 0b642ede4796 > > ("[PATCH] s390: default storage key") added this and it mentions that it > > can be overwritten at build time but I do not see any infrastructure for > > doing that. Any clarification that you can give so we can solve this > > warning would be much appreciated! > > Yes, it is a debugging tool that we use from time to time. The user would then > change PAGE_DEFAULT_ACC in the header file when needed. It was not worth a config > option as normal users should not use it. >