Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp230969pxb; Wed, 15 Sep 2021 00:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhk0Hpl2czys2b8PAl+sNgf8Nl+EmWlHm7bmbTY/lNSg9HFoPGoQS/KzCbhCJADzxfOCTe X-Received: by 2002:a05:6638:dc8:: with SMTP id m8mr18385419jaj.93.1631690186345; Wed, 15 Sep 2021 00:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631690186; cv=none; d=google.com; s=arc-20160816; b=ctI7TgnIFGi6Hs9d7GJ37MR0JsJH/ib2XnDzAQeVKKpk/nXsclkXBjG3RBETmFc4lS fxmAxRL/rS993mZmwLpDqNl80RLV5x/eJvCEgmzAzAIcV5u+wG31OOE8hTbBlwnEe7FM j3vbzMSiZFliQKdHvEUQIo8DG6wH4N+SPFAzxzMx+PGz6BHrjPPBiL+RHrszDH3teRx3 HaMkQUgRHDKtzs9Q/AhGcSWZp6So4/0yLH1pTWeEz2xb+T3RZW7a9juAqxZSmEZIWNqW QrtgjfHCRCWpvzKga+wP4OCHI+oWFp2H0sK9b0fpOa/x0rhSUiR9FT1TLOdG9QXEr3cs Tspw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=A1IVxZky5BSyTBU+SMqP82fNBqVRZRpdJnYicnKM2s0=; b=gpIqKG44DgiAshjrWXIErG3vg5GSURpxTZSrFUNmQFQZO8GbPWtiSV5sNoJMpXkgZv FJH63PqINcdHTE9pjD9uMNYHY5AvezTLSJlf05RGCATO61SZed/kQysM+fpNLfgXqht0 hYVGI5ECBOsThNJp145TLca4mFGzN9Xj1nByVMhpzHbBnAlCFo+peY4OrSanAofywsjV 59+3tU49kOQ3/mq6XdG6yv/VM9MRG1xei/I2abyHiXCwadxJeQGvoBFarPzxecptGZPh T3R3LyaGWQWTFr37SzsrrZF7qkloRCxn7jIeEzHMobDU4N/x5RRvxXj4cI8YQqPnmDn3 iagQ== 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 j8si5479434jat.1.2021.09.15.00.16.13; Wed, 15 Sep 2021 00:16: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 S236585AbhIOHOn convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Sep 2021 03:14:43 -0400 Received: from mail-ua1-f41.google.com ([209.85.222.41]:36423 "EHLO mail-ua1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236571AbhIOHOm (ORCPT ); Wed, 15 Sep 2021 03:14:42 -0400 Received: by mail-ua1-f41.google.com with SMTP id u11so1093173uaw.3; Wed, 15 Sep 2021 00:13:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gL3z2tWaeR9gQ68ZsbvDrdBbJQtIPd0iNGfdcj7Yqw0=; b=MZnTBoLp0kte0QteC0VOy/nqLcEOBj1ddS6iv29JMD1qpgjYFy8K46SlaZwX2OipnY UcfgSIFGW+X8YYRb8RCP3O79yyqQdRajgOvCj2fXaTtSybazm4mb+ynE9h725jkv9tRe KqaJNu8mtoeCWZWoxJR8uzf0PlgX3gMIGurD3PkBjyB2g8dba85E8x6UpIOlmowvWBhQ U6nkOgwouB4tZb3JNE2+yxZmK9wpP9OIjJixRnhhT/x9HCR7giqAHFEsxiEVTCNZPIUC Xj93x2OanYpq/VtRj4VYj72kEb14mrC0ZnlPCcenTpaQsFk+gSfgZGddifTEAj4TUXb8 73iQ== X-Gm-Message-State: AOAM530kY5sRhGRAmr8aaOZ+eVkL63VqkvNHSlD9StDb4Uyhtr67LJF5 cAx3xBzZ9MwFPy101e1jrA+tUHoMIL2a/6bjaH0= X-Received: by 2002:ab0:6ec9:: with SMTP id c9mr7777343uav.114.1631690002856; Wed, 15 Sep 2021 00:13:22 -0700 (PDT) MIME-Version: 1.0 References: <20210915035227.630204-1-linux@roeck-us.net> <20210915035227.630204-2-linux@roeck-us.net> In-Reply-To: <20210915035227.630204-2-linux@roeck-us.net> From: Geert Uytterhoeven Date: Wed, 15 Sep 2021 09:13:11 +0200 Message-ID: Subject: Re: [PATCH v2 1/4] compiler.h: Introduce absolute_pointer macro To: Guenter Roeck Cc: Linus Torvalds , Richard Henderson , Ivan Kokshaysky , Matt Turner , "James E . J . Bottomley" , Helge Deller , "David S . Miller" , Jakub Kicinski , alpha , Linux Kernel Mailing List , Parisc List , netdev , linux-sparse@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Günter, On Wed, Sep 15, 2021 at 5:52 AM Guenter Roeck wrote: > absolute_pointer() disassociates a pointer from its originating symbol > type and context. Use it to prevent compiler warnings/errors such as > > drivers/net/ethernet/i825xx/82596.c: In function 'i82596_probe': > ./arch/m68k/include/asm/string.h:72:25: error: > '__builtin_memcpy' reading 6 bytes from a region of size 0 > [-Werror=stringop-overread] > > Such warnings may be reported by gcc 11.x for string and memory operations > on fixed addresses. > > Suggested-by: Linus Torvalds > Signed-off-by: Guenter Roeck > --- > v2: No change > > include/linux/compiler.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > index b67261a1e3e9..3d5af56337bd 100644 > --- a/include/linux/compiler.h > +++ b/include/linux/compiler.h > @@ -188,6 +188,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, > (typeof(ptr)) (__ptr + (off)); }) > #endif > > +#define absolute_pointer(val) RELOC_HIDE((void *)(val), 0) I guess we're not worried about "val" being evaluated multiple times inside RELOC_HIDE(), as this is mainly intended for constants? 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