Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp244938ybt; Tue, 23 Jun 2020 21:01:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNITAg8ma2S98QEoGJ3OafOfNyBl/CUKCqRBiZu68oqnTl0Psx1bgSlhzZ+bvoO5cWs77x X-Received: by 2002:a50:d753:: with SMTP id i19mr21116756edj.9.1592971295624; Tue, 23 Jun 2020 21:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592971295; cv=none; d=google.com; s=arc-20160816; b=es7VeWCo1omtPcO+Pm3JnBHpRh1u7O25aasBAVl1Dh9XTeAJEX1bnwqbvE9OnAvmqE SY3wJtaxw/6UoqyWEO45OhFdFsC1qW8Fz/Vqw8zQc2LOyCtnT+B6yl16ykhUs6ZdgVdG PhmW/oLUyy+D+mBsNeMjwKPJdh3W3qy95PCcdiRuP6GS5fHy2SSM1fj1iuCRlBkSPJ2e gQ0apySMA/pYeyD5QzDdvmXJnsDRHXJjcg+1W1zCSHvAs6f5JEM73eUmwH41kaZZRW7x TdWV70pmD68bEKA8zLhA/rip8YYPxh+qwpJH74wHvv+iTl5/9G81KWwlfMdjQtgY0k0R lMBQ== 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=TnEdc0adKymab+qTSEaLkwtzD9ZgZSbPfaKonk964fY=; b=XyxJxUti1wkidzLBKMuFGQBWBSWoAfFUM/uy4NrUtZCKB7kRZfULOkzgVAJgYXh9Q0 RYpRb/+Nv7WO4gtU1IDKJW9h3g++VXcgXe4YP3UUCX96HRs3zuvY1cPYfx6z+2WbhmGZ 5mygfcL4sQQ8QS+sXHr/Up+YOEz7OWBkC6mCIQVD64Ly991xFHKakmP0MKikJfzbRKJw Pl94qJA+oKY0Fu/PvCKcpsN3rjMLSqQTaW3EET9qJ9GnlkVDSh1F76wNj672Pqm8JXzB 3oj6xVv5ryVKyuR1eOQavzFOz0YGkfB+wz9QVHVrXjxNQB4cO5wQV9aSw321yyZbL1+/ L1tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OKiltaF1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si5436513edx.295.2020.06.23.21.01.08; Tue, 23 Jun 2020 21:01:35 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OKiltaF1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388714AbgFXD7h (ORCPT + 99 others); Tue, 23 Jun 2020 23:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388393AbgFXD7h (ORCPT ); Tue, 23 Jun 2020 23:59:37 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1CBCC061573 for ; Tue, 23 Jun 2020 20:59:36 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id x202so651868oix.11 for ; Tue, 23 Jun 2020 20:59:36 -0700 (PDT) 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=TnEdc0adKymab+qTSEaLkwtzD9ZgZSbPfaKonk964fY=; b=OKiltaF1uMCaw3/rXHHtnDBJq6LDvUOveCzJD8ZGFs3252odcaMZM+EWC1P5hQVuj+ +dCZcBqeK9VpAr4JzKe7Ipid7gGEWu0QpazZSY7IDTV3pdEpyVdeL4ZgYW4w78TcaTbb QVeTm5wzTZXwn8jqVd6Hu5K/wnUooTFiOc3f6c1rO/EeNK2H5kCJG4eCLC/Iak1kTBI0 D+afQNI7Xn4vkw2TVyp+n8Jr9awtSpGiDbcfmWatJgOiXgiYejsdQWr34mGkRkBtp9OE wB469Ra0RALYhJkazPozIBZE7pkqgaRCUkTw1bAxLI7Olzdz7UtT4MCpddyqyB9kl+fR mi8g== 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=TnEdc0adKymab+qTSEaLkwtzD9ZgZSbPfaKonk964fY=; b=B/ySDIyfnuk0/IUK/XYuG4sLQaGoBLpFKZuclAPSkS5rf4JRgYpC8rO7gW5pxr94qF Dhg/knI6OthSS3YwwLKfDQv6eoqqKM7lxKNA12l031bHqKlhrY067wdj/G53EnZD8ePK NxZeSGaENkDbOFB566uJHytZ3DX0Gdwpw7SeDCAKeYFDoV0QLXHuXWIZkdaXZahm3tKa YwCRn2Zk091tCoEDigIoO8Owut4AaS5LYU/6DeyJjvEmWNFWKAHcmdy0/lkp92oX51E0 3Xi6m+VDZXqdZWCCLcv6YvBbcc05Zag25S1H85OziBOqqZv52wHDNh+79yAz74MnxFhB 7JBw== X-Gm-Message-State: AOAM530l0HXyCu+Uc+LGQQfAabskqRI8+fvu0fJh2sDGC5/3RBxp5E5O 2AHwehYrq5+K/GGpEVxgmHw= X-Received: by 2002:aca:1e0b:: with SMTP id m11mr19113749oic.147.1592971176070; Tue, 23 Jun 2020 20:59:36 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::3]) by smtp.gmail.com with ESMTPSA id m20sm4538380ots.13.2020.06.23.20.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 20:59:35 -0700 (PDT) From: Nathan Chancellor To: Michael Ellerman Cc: Benjamin Herrenschmidt , Paul Mackerras , Geoff Levand , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , Joel Stanley Subject: [PATCH] powerpc/boot: Use address-of operator on section symbols Date: Tue, 23 Jun 2020 20:59:20 -0700 Message-Id: <20200624035920.835571-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.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: arch/powerpc/boot/main.c:107:18: warning: array comparison always evaluates to a constant [-Wtautological-compare] if (_initrd_end > _initrd_start) { ^ arch/powerpc/boot/main.c:155:20: warning: array comparison always evaluates to a constant [-Wtautological-compare] if (_esm_blob_end <= _esm_blob_start) ^ 2 warnings generated. These are not true arrays, they are linker defined symbols, which are just addresses. Using the address of operator silences the warning and does not change the resulting assembly with either clang/ld.lld or gcc/ld (tested with diff + objdump -Dr). Link: https://github.com/ClangBuiltLinux/linux/issues/212 Reported-by: Joel Stanley Signed-off-by: Nathan Chancellor --- arch/powerpc/boot/main.c | 4 ++-- arch/powerpc/boot/ps3.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c index a9d209135975..cae31a6e8f02 100644 --- a/arch/powerpc/boot/main.c +++ b/arch/powerpc/boot/main.c @@ -104,7 +104,7 @@ static struct addr_range prep_initrd(struct addr_range vmlinux, void *chosen, { /* If we have an image attached to us, it overrides anything * supplied by the loader. */ - if (_initrd_end > _initrd_start) { + if (&_initrd_end > &_initrd_start) { printf("Attached initrd image at 0x%p-0x%p\n\r", _initrd_start, _initrd_end); initrd_addr = (unsigned long)_initrd_start; @@ -152,7 +152,7 @@ static void prep_esm_blob(struct addr_range vmlinux, void *chosen) unsigned long esm_blob_addr, esm_blob_size; /* Do we have an ESM (Enter Secure Mode) blob? */ - if (_esm_blob_end <= _esm_blob_start) + if (&_esm_blob_end <= &_esm_blob_start) return; printf("Attached ESM blob at 0x%p-0x%p\n\r", diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c index c52552a681c5..6e4efbdb6b7c 100644 --- a/arch/powerpc/boot/ps3.c +++ b/arch/powerpc/boot/ps3.c @@ -127,7 +127,7 @@ void platform_init(void) ps3_repository_read_rm_size(&rm_size); dt_fixup_memory(0, rm_size); - if (_initrd_end > _initrd_start) { + if (&_initrd_end > &_initrd_start) { setprop_val(chosen, "linux,initrd-start", (u32)(_initrd_start)); setprop_val(chosen, "linux,initrd-end", (u32)(_initrd_end)); } base-commit: 3e08a95294a4fb3702bb3d35ed08028433c37fe6 -- 2.27.0