Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1405042ybv; Thu, 13 Feb 2020 22:44:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyaxuVto61tTaBV3TnDyo+qk9XivohIOOUWrI9O6/HCh/Br/KASYmVLQs5bk7RP43ib6pRP X-Received: by 2002:a9d:395:: with SMTP id f21mr1085332otf.67.1581662650973; Thu, 13 Feb 2020 22:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581662650; cv=none; d=google.com; s=arc-20160816; b=E2DORG3xGuKhKOTMhhTeueLsN89PKV1z4ddohOYcA19CQ2tkvwlv3AZpBfU2vutAT0 pLHkifh+Enl8eg8G+kDy9U8yp+mIcQ27Wiaa1VhSmeAHZl2hsopXS9MI1Z/PVLJnckOU fJi3Ybiu/+nxfdLPAC60LlheKyUPT9vXwGnpGKr4+ZgixdUAegAJj6KwPI6q18tgT0HU TCynYPJY5S+u/56ary6oCUrIp5VERkQa1m4NpEIU8taE+2U46I427uPD30e+N3edzt/R GUrpRQAkHFDtlvwm+A2Zc925Y4iU9j5QVgWTbtsPdtwxGWMSGTqpYe+rO0WuwUzeCPGI 4r7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YK5ShLRmBFVIyNa+AVJi5WDxNZ4pgm/RjqjDGl1K0Lo=; b=IiMXEEF3dfV8zTzcOSQ61j8gYy24xXbgxV2bJ57ouO5OLt8nlPamd4oky9eDOspRYV b5Qc7vZwCER3na6pLZTDO0ovyCYK2g1jF18kRRzEvgo1Nf9hIHrDn6Z9X4UNujQgsA64 nZTR/zQD7F8KQuc2iSdGxTzzqcfgq16cpRmNaTNu8NRPe9qJ0WRZln6iXZnDBVO0GqY5 O/04H/n2bp/vUBAcy5svdrXUcB80QCUaHFEM04uSDkjWFnuOayt1FXAYzaCCPCaHjCj7 gKUQ2QJbMZUXNMuvqtiWuDUKx58DsGwUciESUdZ5NXHX6TkPnNGavczxGnAw7KwxF2Fj 4QiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YMQDTlFe; 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 w77si2315840oif.216.2020.02.13.22.43.58; Thu, 13 Feb 2020 22:44:10 -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=YMQDTlFe; 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 S1726048AbgBNGmu (ORCPT + 99 others); Fri, 14 Feb 2020 01:42:50 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:44554 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgBNGmu (ORCPT ); Fri, 14 Feb 2020 01:42:50 -0500 Received: by mail-ot1-f68.google.com with SMTP id h9so8133833otj.11; Thu, 13 Feb 2020 22:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YK5ShLRmBFVIyNa+AVJi5WDxNZ4pgm/RjqjDGl1K0Lo=; b=YMQDTlFeh4hva6rNIzVXBqVTm1c39bdUSXB8ryOhtsvHgeuKjEedWyVnRSY2rRX0C2 9Lu9Jj1Tq/Wdbi+rKZ2XkPrBRgGwdowBRXdaDfHratiEwgUkyNcGaO55hunh4zm3L8TI b6Fd0mL+Cr3Rpjziy1NejI/xA10rUt4OEj9YCuC+F/6gJL8DfIZ5N84Zx5vFZ6+Kb8st ON+kJXIJhVlPmD4gOOKAEkInrwMJKy5oZ7SpssOQa/3/ug9ZfrhQ3gGopWg0yIqy23cY FxlEjvVEEKKvg5hjBTTPozb12KHYRJC59VqsGVart6+EvjSivnza2/o4/HYE+ZB+PC3X K+rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YK5ShLRmBFVIyNa+AVJi5WDxNZ4pgm/RjqjDGl1K0Lo=; b=mfgMP5xbzP+06I1dda5+6APAr9zaPWbWRUhBDBNyQRnQEcMzSMq452kt3eo37bRdZp fc3HfaTXgTsjPMzEMy1F1uy5Tba6wWZnBGHHz+KczBZTzwUj2AOlxE+A8nmPQ1T7tusi kHVGVtVvgKyfYUqCRDwFoYpWZQ7945cXlOs/XLxPrHCcAjhjM0lu+FvHRfBlrqECLdXK CFSv/Z2u7NWL74urF8Z6jKMcv28qnpC1um4S0KSZMPWhjWO92OQzxzledFZ0B7UuD0Sj 2zDeUtCgj+U+umy3qnopkOKVeZkbD4bZKUbrjzb4uom7M9KKqShfFjrLWpmjMBJg/kJD Xg8Q== X-Gm-Message-State: APjAAAXA9JIsW6R62hG4axj6x9GYKol2A1Yv692aANgwF7Zt0JhDLFqw 3MWzo6KPlHqOMRI0G+k6XZ0= X-Received: by 2002:a05:6830:1e37:: with SMTP id t23mr1143253otr.16.1581662568064; Thu, 13 Feb 2020 22:42:48 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id m2sm1514544oim.13.2020.02.13.22.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 22:42:47 -0800 (PST) From: Nathan Chancellor To: Heiko Carstens , Vasily Gorbik , Christian Borntraeger Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] s390/mm: Explicitly compare PAGE_DEFAULT_KEY against zero in storage_key_init_range Date: Thu, 13 Feb 2020 23:42:07 -0700 Message-Id: <20200214064207.10381-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: In file included from ../arch/s390/purgatory/purgatory.c:10: In file included from ../include/linux/kexec.h:18: In file included from ../include/linux/crash_core.h:6: In file included from ../include/linux/elfcore.h:5: In file included from ../include/linux/user.h:1: In file included from ../arch/s390/include/asm/user.h:11: ../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. Explicitly compare this against zero to silence the warning as it is intended to be used in a boolean context. Fixes: de3fa841e429 ("s390/mm: fix compile for PAGE_DEFAULT_KEY != 0") Link: https://github.com/ClangBuiltLinux/linux/issues/860 Signed-off-by: Nathan Chancellor --- arch/s390/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index 85e944f04c70..1019efd85b9d 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h @@ -42,7 +42,7 @@ void __storage_key_init_range(unsigned long start, unsigned long end); static inline void storage_key_init_range(unsigned long start, unsigned long end) { - if (PAGE_DEFAULT_KEY) + if (PAGE_DEFAULT_KEY != 0) __storage_key_init_range(start, end); } -- 2.25.0