Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp191879ybh; Mon, 20 Jul 2020 14:04:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkjTSKie9tck0T4xQGmSQt1qtq9MbRZBdTU8DIjK+xY4dXuaFIifTw0pSvnPaFsYJ/zCrg X-Received: by 2002:a17:906:35ce:: with SMTP id p14mr19874300ejb.514.1595279066053; Mon, 20 Jul 2020 14:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595279066; cv=none; d=google.com; s=arc-20160816; b=K1pPQFbunw3rbIuB2wz/N1YMjYjqPZ3BHkx+kYM/EvgTc6r/hjLYqjHhIBiM/C7ReC 6npbVRc3ooehvSc8icRP5ZIUjCTJVaVN6abX+3xVNRsCDNffiuPetUBag86EflZ7RVJj Cmcr6RNhxIxG/I8M17yeS7m2zfc8Nswj454MdnTSUGdYOxv7QJhpyMSKA7Afn9otAnOb fy6M34X1IaEQdA4CPA0oVjrcDDm5udWIjEmjQHlPkpaiuY3q6liSYBwVyCf6c2ykMN7d qWhOxj/8e44ik5ekFQCJb4x7QkERyB08COYojytrAtSLh3z/2PCzahZnFqtZK7toDDo9 7GsQ== 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; bh=vT46eOrxeH04MP6A8LGKznD4ZE0eV0FsQaf9bS3iSzk=; b=hxKW6rlffgpakY2B46cl1pb1XiyrMIJ//vUrNdDrVQxdW74aTO+ayt2nQf6nusCsGU uDfDLQEntMdLgfUKzsZCzmLm2LgfBo/c31Uov8PUO4IMTqUYbSmeGx3dZAoGqsDvoan4 RarAbLkPPK+Bc6LAFy5vLVgP1y1tfHqpd5+wN/v2HYw0cQx3NOqFnZ2SDHLknRG46tJw Wamm/4O4BGYOEX6Gz/jwJcid2OybDuoviOJKCMmXf1a2dHm6MPuyZmlQfUIb9IUa31pO LOETasOu7DeDEpbU4vGHZ6VLsy5Sj3p+f6iu4xQwRjiSPrV7GPyftVQLVGnq3+Unms8h 06XA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si11026724eja.474.2020.07.20.14.04.02; Mon, 20 Jul 2020 14:04:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbgGTVDl (ORCPT + 99 others); Mon, 20 Jul 2020 17:03:41 -0400 Received: from gate.crashing.org ([63.228.1.57]:41157 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgGTVDl (ORCPT ); Mon, 20 Jul 2020 17:03:41 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 06KL2tAD003247; Mon, 20 Jul 2020 16:02:55 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 06KL2qPF003246; Mon, 20 Jul 2020 16:02:52 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 20 Jul 2020 16:02:52 -0500 From: Segher Boessenkool To: Geert Uytterhoeven Cc: Nathan Chancellor , Arnd Bergmann , Geoff Levand , Linux Kernel Mailing List , clang-built-linux , Paul Mackerras , Joel Stanley , linuxppc-dev Subject: Re: [PATCH] powerpc/boot: Use address-of operator on section symbols Message-ID: <20200720210252.GO30544@gate.crashing.org> References: <20200624035920.835571-1-natechancellor@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Sat, Jul 18, 2020 at 09:50:50AM +0200, Geert Uytterhoeven wrote: > On Wed, Jun 24, 2020 at 6:02 AM Nathan Chancellor > wrote: > > /* 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) { > > Are you sure that fix is correct? > > extern char _initrd_start[]; > extern char _initrd_end[]; > extern char _esm_blob_start[]; > extern char _esm_blob_end[]; > > Of course the result of their comparison is a constant, as the addresses > are constant. If clangs warns about it, perhaps that warning should be moved > to W=1? > > But adding "&" is not correct, according to C. Why not? 6.5.3.2/3 The unary & operator yields the address of its operand. [...] Otherwise, the result is a pointer to the object or function designated by its operand. This is the same as using the name of an array without anything else, yes. It is a bit clearer if it would not be declared as array, perhaps, but it is correct just fine like this. Segher