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 A28DCC433EF for ; Mon, 27 Sep 2021 17:28:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C5DD610FC for ; Mon, 27 Sep 2021 17:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237371AbhI0R3s (ORCPT ); Mon, 27 Sep 2021 13:29:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:41188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236138AbhI0R1j (ORCPT ); Mon, 27 Sep 2021 13:27:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 491FD60FC2; Mon, 27 Sep 2021 17:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632763014; bh=fWjdsQvfYIIqpLa9i2nBmD08qc6V7uV2NfM5YXqQBA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnvQMU6GF3HX7Zkd4r8wIfFysx3zTLA8a8Fn9obve+d0U6iFdzvRV0FVaYOpIkhD0 KFI7gWs4w+irBl4FaClCn985kZv8FxA6sK+sm9/9K1Bje96rlJtbOU3xCniiB2cFBx 5HDLVCrOCKWLBwy8qoI5fCRR0ZP8WWr5NPRWuuEc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Guenter Roeck , Linus Torvalds , Sasha Levin Subject: [PATCH 5.14 136/162] net: i825xx: Use absolute_pointer for memcpy from fixed memory location Date: Mon, 27 Sep 2021 19:03:02 +0200 Message-Id: <20210927170238.130082491@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210927170233.453060397@linuxfoundation.org> References: <20210927170233.453060397@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 dff2d13114f0beec448da9b3716204eb34b0cf41 ] gcc 11.x reports the following compiler warning/error. 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] Use absolute_pointer() to work around the problem. Cc: Geert Uytterhoeven Signed-off-by: Guenter Roeck Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- drivers/net/ethernet/i825xx/82596.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/i825xx/82596.c b/drivers/net/ethernet/i825xx/82596.c index fc8c7cd67471..8b12a5ab3818 100644 --- a/drivers/net/ethernet/i825xx/82596.c +++ b/drivers/net/ethernet/i825xx/82596.c @@ -1155,7 +1155,7 @@ struct net_device * __init i82596_probe(int unit) err = -ENODEV; goto out; } - memcpy(eth_addr, (void *) 0xfffc1f2c, ETH_ALEN); /* YUCK! Get addr from NOVRAM */ + memcpy(eth_addr, absolute_pointer(0xfffc1f2c), ETH_ALEN); /* YUCK! Get addr from NOVRAM */ dev->base_addr = MVME_I596_BASE; dev->irq = (unsigned) MVME16x_IRQ_I596; goto found; -- 2.33.0