Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp415833pxu; Tue, 5 Jan 2021 15:02:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1NEP07iWtIQ4KB9KEG0wOiCyRdZC0h2hhUFyBlcvhySLEGuEixiFVVuCuZJkp1ymFLzkV X-Received: by 2002:a50:d552:: with SMTP id f18mr2016860edj.168.1609887728960; Tue, 05 Jan 2021 15:02:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609887728; cv=none; d=google.com; s=arc-20160816; b=i/WoHREi3UMXqU/toTbv79jonsaI1ktNYsqMZQwIvAdITzjAC3WYoFVSi5JmfBdYbI TzsQwbUbTAA3/CalKpOJarvzVN0gfA8X4DXKXqPI9fuzq7SZYbcKLFknnifV7Ln/qmyY Ox3O46j2zDSM+YWc7M32CIPUl+xYS5O+r8VFMQyBMXb9GBVCPXNYjeI6Zj9H8CHDoBYr FcMi4/4U67a+NpD05bOB1hkXFnNk/3ierA6QBnUw5ImsQV80VKNaH/L3tUKbp0xCSPYa YjRu89GQQLito9Ye1gFqXh/8hS8BZIqRjBs/XVP95gjdKoSYX/4I4o9mwQMbV1jxIL3u Vz9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6NEnic80tcUo3+yVoxdPk0SMP2vGpWUPUrthjFQDkyc=; b=pCoUzS1WSAOwHo+nDY3Eu/fxpoILWYiBQ0ZEy51UJDFpMh9ZSG/XZuCukjLlpYjDwe M7lI8xAjCpyc27LBdb475KdFcM3RHqAP9tMDQ9b/Avdih8/aNL7j5aMIqIz4+KM091OZ /TgFdsOfyxYaNjwsvDekXFq2B3hBpui0SS2vZ+qP0jD8izWwt/gVPQzdYVdfr4H3Y9N6 L1DQrDEqZxok29QiIEjLlQJb95k+Pak+J4bY+K64cb2sqvIJtki0dfSEhW9a/Dwe/m5Q diW9N5bxmP4Afgm6Csq/nGCetbLtvf3Gc2U2x0cp5iQUoUD4CP7rYkPwbo7i+WUMdUff 4vIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bjKr0rNP; 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 v8si248233ejj.305.2021.01.05.15.01.45; Tue, 05 Jan 2021 15:02:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bjKr0rNP; 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 S1729465AbhAEUTQ (ORCPT + 99 others); Tue, 5 Jan 2021 15:19:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725769AbhAEUTQ (ORCPT ); Tue, 5 Jan 2021 15:19:16 -0500 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB4BC061574; Tue, 5 Jan 2021 12:18:35 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id d14so529196qkc.13; Tue, 05 Jan 2021 12:18:35 -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=6NEnic80tcUo3+yVoxdPk0SMP2vGpWUPUrthjFQDkyc=; b=bjKr0rNPdSfS5qRBw050TlXxNM9LGC7XQlj0qjPQWdYRRQzwA8OB7JPd1pSewiq51x UG/rbeUCpyUw3pLVOUfAqNgzJVJRBiv7Aw4i9r6g8CnNlWxmBRW1410XH5sKBZ7yjH/r ILjJSepQGGOGmo6bVZaxEzYN5GAaHd+ii5o8uoFBMERyw4loh9/7G1KPQ8szLpY/7pJD rL7OZhy7JbiPKfxUx+Xd/6rmUNU2lAy9nKf7xzvzSBguQEaGnnkyv1VZC5BKZQfmPYSs +FnkTRhktRyhmhNIl+7MM5PC4oQwnK4W/Biw9y0ykIyv9RSrfr7RcC5F5RlX2Lwz65Sq otVQ== 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=6NEnic80tcUo3+yVoxdPk0SMP2vGpWUPUrthjFQDkyc=; b=GKAm7MtcG9yzTOilPDpxdbSpsnkSRt7ZqCfbYVzLl8cnOKFXh2xKbO16kd/Sw8Jm9c tK3dmXk6htneZ1b+wrxKAEHrS34K85Y0VY3iMXAHigjnIxeKj0ttFJNruvmUaq92lLDY nTHoPS7Rv4udGjIY/r1S8RDTICnm8FbtE9JajBshSolsidtmgyHplW6WB7PGMJT7bVJB dA+IK/HO618VmOE8vCwpYdJUKpNwTCoTY0VgL63/QVVeLkJ97v5R2w1IWfvChssk3Igz +yzPnLOPejtMEp/cHH4QeWqvdpZkrcU//XNwfnUKw5oOj/amSLgVOTigiVh+vn8Xc2dL ij+A== X-Gm-Message-State: AOAM5332a4oniJ/geAvy9/3QY4uD+2hYls6SstY2KJZoXBmhYh7COurx HMVTjCmbzNRioKhX6rKBmC0= X-Received: by 2002:a37:a40d:: with SMTP id n13mr1238262qke.47.1609877915054; Tue, 05 Jan 2021 12:18:35 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id d84sm235057qke.47.2021.01.05.12.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 12:18:34 -0800 (PST) From: Nathan Chancellor To: Thomas Bogendoerfer Cc: Florian Fainelli , John Crispin , Nick Desaulniers , bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] MIPS: Use address-of operator on section symbols Date: Tue, 5 Jan 2021 13:18:27 -0700 Message-Id: <20210105201827.51766-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building xway_defconfig with clang: arch/mips/lantiq/prom.c:82:23: error: array comparison always evaluates to true [-Werror,-Wtautological-compare] else if (__dtb_start != __dtb_end) ^ 1 error 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). Do the same thing across the entire MIPS subsystem to ensure there are no more warnings around this type of comparison. Link: https://github.com/ClangBuiltLinux/linux/issues/1232 Signed-off-by: Nathan Chancellor --- arch/mips/bmips/setup.c | 2 +- arch/mips/lantiq/prom.c | 2 +- arch/mips/pic32/pic32mzda/init.c | 2 +- arch/mips/ralink/of.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c index 19308df5f577..1b06b25aea87 100644 --- a/arch/mips/bmips/setup.c +++ b/arch/mips/bmips/setup.c @@ -167,7 +167,7 @@ void __init plat_mem_setup(void) dtb = phys_to_virt(fw_arg2); else if (fw_passed_dtb) /* UHI interface or appended dtb */ dtb = (void *)fw_passed_dtb; - else if (__dtb_start != __dtb_end) + else if (&__dtb_start != &__dtb_end) dtb = (void *)__dtb_start; else panic("no dtb found"); diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c index 51a218f04fe0..3f568f5aae2d 100644 --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c @@ -79,7 +79,7 @@ void __init plat_mem_setup(void) if (fw_passed_dtb) /* UHI interface */ dtb = (void *)fw_passed_dtb; - else if (__dtb_start != __dtb_end) + else if (&__dtb_start != &__dtb_end) dtb = (void *)__dtb_start; else panic("no dtb found"); diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/init.c index 50f376f058f4..f232c77ff526 100644 --- a/arch/mips/pic32/pic32mzda/init.c +++ b/arch/mips/pic32/pic32mzda/init.c @@ -28,7 +28,7 @@ static ulong get_fdtaddr(void) if (fw_passed_dtb && !fw_arg2 && !fw_arg3) return (ulong)fw_passed_dtb; - if (__dtb_start < __dtb_end) + if (&__dtb_start < &__dtb_end) ftaddr = (ulong)__dtb_start; return ftaddr; diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c index cbae9d23ab7f..2c9af61efc20 100644 --- a/arch/mips/ralink/of.c +++ b/arch/mips/ralink/of.c @@ -75,7 +75,7 @@ void __init plat_mem_setup(void) */ if (fw_passed_dtb) dtb = (void *)fw_passed_dtb; - else if (__dtb_start != __dtb_end) + else if (&__dtb_start != &__dtb_end) dtb = (void *)__dtb_start; __dt_setup_arch(dtb); base-commit: 36bbbd0e234d817938bdc52121a0f5473b3e58f5 -- 2.30.0