Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1935480pxa; Mon, 3 Aug 2020 03:07:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi37trpKWmzoFVNcVYMpXmT2VskI/bfMNnfW0uJtxJ9kHt21nggAeGvein4dPuXiwiTHlH X-Received: by 2002:a17:906:7c86:: with SMTP id w6mr15448901ejo.178.1596449249324; Mon, 03 Aug 2020 03:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596449249; cv=none; d=google.com; s=arc-20160816; b=H7hO/6nIfgr0IVSgjvOUdFe3vai4vfEk2rFHjYuvUF5ozXkPx6iSFF7r88YPv/U5Yd 3lN+qDRp1kUnmB7q+UeB5APFjQsCB3RHFTH1CBF2P+s5QMvBhwy5a9TnQ0Q2lIab2USJ 41fyff6Vi3A0dNpI6lEIUMFFEN1d/sF3nmGYXIbJ3AxtGZnMAVlgv+XoFlFZEL7TkmyN s6hIHmIlgtKUqrQ80nEjdnYDTQDouNThEt6l+LBoJEKa7pgU1FJj8DMNitpWRR+N4W7Y GtLQ4ElhegTLnWJgQwbQJ5KXCUKyT+Hy5AEcaB8qHlzvkHR4Ubx+HW/lQQikCb8WtaFG d/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=OpbEohH8OUi/epyUcg1f5tBFIW7tKev1cp8OSm9Qyi4=; b=nUkqq9fKAs+fqWcLYy8kOvDWQBM4n+9RvymOYHNGYJZZ6aZzzsJIMXJ+ftw19yZUKw CpJx1lQSZWNyUjvRl4vArhFYKVrTl3lGGPVZhiwDoiTtyrpiF/aP+hKEOP4cjaRvc78c m9nmYu5psJD0Ghh05y40/rzXYxgdukp5W23HPxTJ4T+izmh4+GfTVuy9BsbGeXnbisP2 pZfBW2ozSVxreneajaP4GUNrN5DV71PgCVtqxPlGSGG33YdzWWjdKolOPxzlq8q6A74e e00j9eYeYU4a3o+XcBKljJ6YNV8M9gLH+MskS0abfA+367eIIsNRYXMnlEoLrej91SeF ShAA== 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 v1si10417704ejd.505.2020.08.03.03.07.06; Mon, 03 Aug 2020 03:07:29 -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 S1726130AbgHCKGr (ORCPT + 99 others); Mon, 3 Aug 2020 06:06:47 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:41454 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725968AbgHCKGq (ORCPT ); Mon, 3 Aug 2020 06:06:46 -0400 Received: by mail-ot1-f65.google.com with SMTP id a65so18318855otc.8 for ; Mon, 03 Aug 2020 03:06:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OpbEohH8OUi/epyUcg1f5tBFIW7tKev1cp8OSm9Qyi4=; b=n6XYC6aSPyxdP+K8fleJR77XF/g6c4k7ygEXE+1JJ/EPDGebbj3WEoOi/Il1gkrl4x fxSNYz7rgjaRxUrdzYyaxtuVdSg/UTB9c3hI4tIRbRm6oNj1ZtrPqmu3R6VBEkpt4Du4 IuQ1OpVQEaR9ls8aoGsmZjd1oJTH09O7ioQcI2mzZUi6SRGiHpbiOs1vguQzQhvhl+o3 6REPBgYOVFxbI6nRV6rVqTW45ZNX5LdcHM7cETt7irDdYVUB08CEUzONEMhOQRxosnQH yk+Yn314ckYaZXSmClkBRAigeaVflBkNqCnejbytlwvgJC978EBnGbPV+hahSSQs9PiU I6ZA== X-Gm-Message-State: AOAM531M1+v8KGmP/VFhiS5G7QqHphy9sAa0Cej3lkD0AlFTz72aK5sX U8PR+SP9ovKKoYXz7SDM+py2h3l2vKSXEkoU7o0= X-Received: by 2002:a9d:7d8c:: with SMTP id j12mr13074211otn.250.1596449205821; Mon, 03 Aug 2020 03:06:45 -0700 (PDT) MIME-Version: 1.0 References: <20200624035920.835571-1-natechancellor@gmail.com> <20200720210252.GO30544@gate.crashing.org> In-Reply-To: <20200720210252.GO30544@gate.crashing.org> From: Geert Uytterhoeven Date: Mon, 3 Aug 2020 12:06:34 +0200 Message-ID: Subject: Re: [PATCH] powerpc/boot: Use address-of operator on section symbols To: Segher Boessenkool Cc: Nathan Chancellor , Arnd Bergmann , Geoff Levand , Linux Kernel Mailing List , clang-built-linux , Paul Mackerras , Joel Stanley , linuxppc-dev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Segher, On Mon, Jul 20, 2020 at 11:03 PM Segher Boessenkool wrote: > 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. Thanks, I stand corrected. Regardless, the comparison is still a comparison between two constant addresses, so my fear is that the compiler will start generating warnings for that in the near or distant future, making this change futile. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds