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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9349C433F5 for ; Mon, 4 Oct 2021 13:08:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D55CD61BC2 for ; Mon, 4 Oct 2021 13:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234119AbhJDNJ7 (ORCPT ); Mon, 4 Oct 2021 09:09:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:44986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235636AbhJDNIu (ORCPT ); Mon, 4 Oct 2021 09:08:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C41CC61B5F; Mon, 4 Oct 2021 13:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633352569; bh=+wYsI52atHo2ux8D6F65OaFgCER6I/1TSchdi9T/f8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aS74nfGzfS2mptASNjuzS5jbkS9NWjSUxQBqLSxi/YMKo+Xwai7Pw2dYQDyD8S/GG M8XQdLk7wDSOzwc5Um0CIqOhBhpksnJEJVKwcRjCWQa15K66GiZiaKjHZmzWnQDGzy pFCEIEAPVSql4pWgFrbHrqHVtKLFAayA9hbJqKjw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds , Guenter Roeck , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 4.19 38/95] compiler.h: Introduce absolute_pointer macro Date: Mon, 4 Oct 2021 14:52:08 +0200 Message-Id: <20211004125034.819040728@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125033.572932188@linuxfoundation.org> References: <20211004125033.572932188@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Guenter Roeck [ Upstream commit f6b5f1a56987de837f8e25cd560847106b8632a8 ] 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 Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/compiler.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 6a53300cbd1e..ab9dfb14f486 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -228,6 +228,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) + #ifndef OPTIMIZER_HIDE_VAR /* Make the optimizer believe the variable can be manipulated arbitrarily. */ #define OPTIMIZER_HIDE_VAR(var) \ -- 2.33.0