Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp126856pxb; Tue, 14 Sep 2021 20:54:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfQ1iBwFlDXP69tFv4ZVnuvmjMJAkhhTfUVKmET28DTMWcVn20en/NkJfwGBlan5FgW5pb X-Received: by 2002:a92:d102:: with SMTP id a2mr14589733ilb.162.1631678052055; Tue, 14 Sep 2021 20:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631678052; cv=none; d=google.com; s=arc-20160816; b=yVeAvJXbYbfblTd9iKqtkXSTv5mJT5YgBWZPDVMhwtJKTJsvq5I9CPeVxgq3tmBghw sJc71Oysspl7oTVq4VuoL6Wz0G8sOIHqa3dsOtKVldkBN9cnpxMNjqDdutSJMl9VojZj CUTb1WXiXINBrgZaC/UD729vh24uhXeUY3FlPB0UVt+quE1gdsKAG7sIQBV5zC75v942 nQkibzwYMeO1AbGW2DgTP58XGPMjLk/E3y/fbE8KtSqOrJ824+rf/Mm0KSzpF00RJMeH yATIP01JFLo4IgsZRtAS54C+aj5wjSPa8ez1FLnKyBzdrsLQ4/94a0QQhxiE3u8zO40d JgjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=aSjFc8iMNGiFbg7CQVDwoW1UzNaNt3hOiMgdB3yaK6Q=; b=DtQytFCBwsdKxuLNsjE44T8wQNNbNlMgd0++Yn+Q26P+9aIduZbrvxlktbCnm8avqZ +JXIup8fskCqbjrR1/smfNNMclqQeNrTDxP/QcIW9l29+Schc6hEzTlbkL1PyOmAvLsd 0lTc6gm3Bl4DSuW82bGk6/PHyo7zmPjFUwvgy0/GxL1tFftROL4EeVwpQ6bpCI42zbsV 26O9kQySeGv8FTRddO1JpPruceXTtHEq+QEhmu41jwsRKDXSq6qox1nK7Fn4sgMJ+xpq TaJbEtE3KT73+NMSMTPEflh0+2fzAEu3EFfe7LgArZg/0txYWRdU86l8xTAE7rTm7E6Y 5LOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=avFYgPC7; 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 h33si13236998jav.17.2021.09.14.20.54.00; Tue, 14 Sep 2021 20:54:12 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=avFYgPC7; 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 S236377AbhIODxz (ORCPT + 99 others); Tue, 14 Sep 2021 23:53:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236361AbhIODxw (ORCPT ); Tue, 14 Sep 2021 23:53:52 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC7EC061574; Tue, 14 Sep 2021 20:52:34 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id k12-20020a056830150c00b0051abe7f680bso1796904otp.1; Tue, 14 Sep 2021 20:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aSjFc8iMNGiFbg7CQVDwoW1UzNaNt3hOiMgdB3yaK6Q=; b=avFYgPC7uaqq4BQUqTkrdfHqJOlz0Pvdl1zxUeSN961ECarn+UhUThOo+h8V6dp6Xm QTFpftfBJLDOqb8FviFk9y4kf92iTH45DoWBmeS02OKmmxWKEYROpsgPMmgOYmB53rND JFo70jqrQAIVZe2+M4oqVVUQ36Co96fZdV1yG2iMIJIz7uydiQASPbq7QzORALwhcZ4y yzCPf1IxUFITfqyoQFzxeyvV7tCQk9ZFa5uBTpXlYJEAshRcy1UUZvs1ykHaXNGZG0pV X0IY7Oj9CLSa9Gyq/A7pDZkCLBM6euB8D4FE4LKOyWHvX/N1p52re2oFsGk7PuIc/mqQ dGkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aSjFc8iMNGiFbg7CQVDwoW1UzNaNt3hOiMgdB3yaK6Q=; b=VRM/VAxz1t9HwB2KXTMHETXf19831ZvcY95MTFmyg18xv8QeH5z6oP/qwT4nsqx7a3 tXksWAaEfJB74AtCfCPlJRxCHkqqMYJvl7u10I+I/ia426KXXUCR8wB9q+tn0bwaLwML X1aURwNiy/dKzWBcbCfS3R0v92cU/OKUvVLX2jz0oAwfsW1SuWb0PBafq4TapJ4JcDJW I86svVd471M/pz0ivMH/Xe6BGrH4RjmRClayUU/GnfgSBNVAlMLCfL4/yuDuFsc5ZuUZ 4D3kcAZU6yVVsAEiAvsZI50SpP28nAqac0icvmr366eke3+nepItj5zrvfWCbMhGOig6 4hPw== X-Gm-Message-State: AOAM530xcyGGYcmMJng2byN4OUOhp5gUqmZ0fKidtRXoeUkDwoCMorw4 ie1kULApeQCA0EqX/fucerQ= X-Received: by 2002:a9d:6a4b:: with SMTP id h11mr17799987otn.5.1631677953527; Tue, 14 Sep 2021 20:52:33 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n19sm3018134otl.63.2021.09.14.20.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 20:52:33 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: Linus Torvalds Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , "James E . J . Bottomley" , Helge Deller , "David S . Miller" , Jakub Kicinski , linux-alpha@vger.kernel.org, Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, netdev@vger.kernel.org, linux-sparse@vger.kernel.org, Guenter Roeck Subject: [PATCH v2 1/4] compiler.h: Introduce absolute_pointer macro Date: Tue, 14 Sep 2021 20:52:24 -0700 Message-Id: <20210915035227.630204-2-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210915035227.630204-1-linux@roeck-us.net> References: <20210915035227.630204-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) + #ifndef OPTIMIZER_HIDE_VAR /* Make the optimizer believe the variable can be manipulated arbitrarily. */ #define OPTIMIZER_HIDE_VAR(var) \ -- 2.33.0