From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0418C433EF for ; Wed, 15 Sep 2021 07:13:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94DA56115B for ; Wed, 15 Sep 2021 07:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234862AbhIOHOn convert rfc822-to-8bit (ORCPT ); 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-Google-Smtp-Source: ABdhPJwMlq/6v9N2i8levGOTrmjVHBDQjw5jjBWFbomargFDdg/nJiQIcblwYe4WWeIs4KIzK7wOuDdDhvdAR/OeHzw= 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-parisc@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