From patchwork Sun Sep 12 16:01:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12486945 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 588E3C433F5 for ; Sun, 12 Sep 2021 16:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4386C60FDC for ; Sun, 12 Sep 2021 16:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235850AbhILQDM (ORCPT ); Sun, 12 Sep 2021 12:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235629AbhILQDL (ORCPT ); Sun, 12 Sep 2021 12:03:11 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B0B1C061574; Sun, 12 Sep 2021 09:01:57 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id h133so10790859oib.7; Sun, 12 Sep 2021 09:01:57 -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=r6G6ldfRmdQpkB7KqHuOk4bEneXh0SM7mr0HLHhwSw8=; b=Bu0ce9k4resy7k5SZrD1WQhVmkSYhOoeHGzkZzv5Nc0B8bWGhxx/Aj4TjiehegdBaI LjN9bn+MJyB7uApcAcmFGLSTx5bDUpvklEmd8X2zd9/X7xA87vJr2zOo3Hy18p0Fx+zG ncXGtq1jgqh4lE2zR97Jo/+BtoriyOKylSjH6n726eJSSNyu18uZrhdqxsT5Y9mkfWRb 5fKb1KLr5LG134I5wVxPxDxnWX+1+7H9M1Llt2mzRMrlwo3T+xzlbL1swSN0eY7g9FA+ vNtAm8yzpANFF9m69/crzCeMa/716WoXl3nZNCzx7m/colUgdcATEKlSjQMIPHd4C/bp qrEQ== 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=r6G6ldfRmdQpkB7KqHuOk4bEneXh0SM7mr0HLHhwSw8=; b=trzuX56VWWp2EyS9+a1SA/KjWxTUI3/sALIPUZPXgsqE67Rz3vy7n1mwKxJRR2CZHS 6HVJpZX5B6BhXu+LRuHfvjDKdrW6StF8FaOV+qA2mHFiVOeXNgT/NupEawdGQ71+gFOS WOdhbV0mNQgrGEMrVyx8PFsUIzYusOxGhAjaHsS6dQ7UPDBIqkzLw8MY88v6oAiDyxJ8 9wqIrPvXQ/qFc0Qiwvmat2C03k97+XVHcWSMnGGVZet/1kwrWsPNnK9V4u5vhjdsO4Ib 6Bjh3yigrwK4qvl6IcR+H5jXlvAWd9Jt57JPTLMnKkFDNb03h5LMJ89SYffUibTpChBP pstw== X-Gm-Message-State: AOAM5323lC07+Dv/s5GLvPZmbCMAf1nx0bKvb6gSGhqfbrb3dwitaCLF 2w5zO04Z+9MLyHa/cdkjf2o= X-Google-Smtp-Source: ABdhPJyKGqBaOj81pr0qET58gYEEBpqySIzGQ108MPp0ABoUxX6pME3N37AAiPoHuKPvfsSilR0TQw== X-Received: by 2002:a54:4714:: with SMTP id k20mr4992666oik.103.1631462516902; Sun, 12 Sep 2021 09:01:56 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b11sm1195841ooi.0.2021.09.12.09.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 09:01:56 -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 1/4] compiler.h: Introduce absolute_pointer macro Date: Sun, 12 Sep 2021 09:01:46 -0700 Message-Id: <20210912160149.2227137-2-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210912160149.2227137-1-linux@roeck-us.net> References: <20210912160149.2227137-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sparse@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 --- 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) \ From patchwork Sun Sep 12 16:01:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12486947 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 CC81EC433FE for ; Sun, 12 Sep 2021 16:02:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B42CC60FDC for ; Sun, 12 Sep 2021 16:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235876AbhILQDW (ORCPT ); Sun, 12 Sep 2021 12:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235890AbhILQDN (ORCPT ); Sun, 12 Sep 2021 12:03:13 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70903C06175F; Sun, 12 Sep 2021 09:01:59 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id i8-20020a056830402800b0051afc3e373aso9867983ots.5; Sun, 12 Sep 2021 09:01:59 -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=tyfgbpEWB0om8tzf9mpCL7ZcoNm2ky582Pji67hHRFQ=; b=FipBo31bo4Y9wn2cwKQRxkhXZxLWCn+R45DcIskkVp75c1TgMGyjogwJwyZOXFC4tv stoxC1TbwWGQ+SVkngtXViHocHoaVTtD2BBYiJPvDjNTybowvZ5OzMJ0BvcZBw1tSFVV WvuF8X0N5/D8+gT4APANqLNRhq+59UrNncv3vpGQBPma8SCO7gYwVE6iGXjpUZDSx5LK Mrre1qNJSrKUOp7Bz8xYEI5VjP5yPoQFMHyY65D1co3w7stKAEc0MHHesMO+X31r8VOS nbGd99VOHdmPbZHJyPppMEZ1X8zmprSmHfblrUwwAkfgGe5JEZF/CJPrdQSQaVVyJAYv OeTg== 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=tyfgbpEWB0om8tzf9mpCL7ZcoNm2ky582Pji67hHRFQ=; b=kuVVKphCs7lCFENKBeX639R8znLBqOyB4vueN6wQvvDRbHtmLZMQo3yjcLwzQ5S9h7 PPWhTYDltwBsNdfjUGyc8ONSv9YXRSwEBkYMvfqDLn0vjIvnN/Bb0wYFzHUtoiEEb2ed 6drADNG0LVEMUVajecAuvbjhITcu6tsD2mOXwq2NNVhC62U1ck0zKp7YvtPHRDC7tnMg fnbx9UGborB4PTnpZTbajG9nOT+/i58PKB1AKhL6HNwBotmh72zLGerCYGeExwANYFIV T7Qpx6wdr/MnqVsUzewvOlN+Y8MYgABaqOMlCYZOA/TMNh04CWvuh68crMsGgPwXnnuT p8Og== X-Gm-Message-State: AOAM533sXR8jF19Tyslzm7I+RpovkAlOCUT+AGWHTz/zYET6GbxR1TIk KQZAio+3hiuJcEmtYLPtBBE= X-Google-Smtp-Source: ABdhPJxxG3bEJyuh5jpoScB+mVZoZXu5mY1xmvYgshRPfbEKeGsAX+9/2UT/b42Hz89aP+JjI1OTIA== X-Received: by 2002:a9d:410:: with SMTP id 16mr6428022otc.83.1631462518827; Sun, 12 Sep 2021 09:01:58 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id t1sm1208957otp.9.2021.09.12.09.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 09:01:58 -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 2/4] net: i825xx: Use absolute_pointer for memcpy on fixed memory location Date: Sun, 12 Sep 2021 09:01:47 -0700 Message-Id: <20210912160149.2227137-3-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210912160149.2227137-1-linux@roeck-us.net> References: <20210912160149.2227137-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org 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_address() to work around the problem. Cc: Geert Uytterhoeven Signed-off-by: Guenter Roeck --- 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 b8a40146b895..b482f6f633bd 100644 --- a/drivers/net/ethernet/i825xx/82596.c +++ b/drivers/net/ethernet/i825xx/82596.c @@ -1144,7 +1144,7 @@ static struct net_device * __init i82596_probe(void) 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; From patchwork Sun Sep 12 16:01:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12486949 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 F1197C433EF for ; Sun, 12 Sep 2021 16:02:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D139360F4A for ; Sun, 12 Sep 2021 16:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236095AbhILQDa (ORCPT ); Sun, 12 Sep 2021 12:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236007AbhILQDV (ORCPT ); Sun, 12 Sep 2021 12:03:21 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67375C061767; Sun, 12 Sep 2021 09:02:01 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id k12-20020a056830150c00b0051abe7f680bso9863720otp.1; Sun, 12 Sep 2021 09:02:01 -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=1/KmRngdTFmzo/UZtKn8rZGj6ovhn9EKtKsKEFMmxn8=; b=amNjEwmKkK+EAJ9qU3oqx/lS59tXH0W5/YF8YlPF3GV2qc12vsrXWzh7XtqybrGlAs o6pIua5w6eKY4OoNzk01slxP4ZKoUpwEix20mxfLDymqeV6qI2QXBDtCpG/j/Axk/5Hn SL/Y6srbyHVRRcSQMUrQJX1adW0ddv0klYEXAcmoYLpDRJ0YEwI7heQhBx5g0pmX2EI9 a81hkcyl2X4pwumIopWL6c0I0MnYiRhIcqNy+fzEBpMbEWKPQmI90TT9YmHFZavmyr9s dNxNgJxkpemPqlCLDg+7wlA8W6T1DHqssu6DB6v754xvJKFfmGv/rH/iU1X1Jihdtho4 kwLw== 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=1/KmRngdTFmzo/UZtKn8rZGj6ovhn9EKtKsKEFMmxn8=; b=D6q+IqESzyMygrR/qu31acOgBFOqoLxI6r3hK9kfhaHSPKgdw2TU7TN4rrahLwbjXc d4XpX940c/3LZfunW4RfDut8Ezewnn88FpkD1+suAKYfLS7nBparuyQMpfaMI3horVVS pPGgIc0iI9yzleIzKCgRHAuwv1b9G5W5CRXK4mI3S//ZSmDGHzPF0xcuxNUIvjy5DKWb uY7llCXUWxci4GtmABIurI6ZBO3B30+nC+gJBN4GW/kuRx3h10aYesG9XvdFYkREolR0 dkAnT54A+iIIPpsrpAvpxjpmXcA5UDa9qeyk62h1JNdtX5ied4tlOgmWJCvII9fEg4Xh st3g== X-Gm-Message-State: AOAM53020z7QC+bK5j/SgKOIfmYv7WWby4HOOaGQ7H9E3c0o+H+slTYs QrUgjD1sThUkEc/RCFp9Fsg= X-Google-Smtp-Source: ABdhPJyHZowChSylgmGOCRZlO/Fx09vA0coF7aqUN5xcR70/VpKTCHElmrsr5xSOKIOtgEY5NKK4Ng== X-Received: by 2002:a9d:7a4e:: with SMTP id z14mr6569712otm.366.1631462520789; Sun, 12 Sep 2021 09:02:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id s24sm1200792otp.37.2021.09.12.09.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 09:02:00 -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 3/4] parisc: Use absolute_pointer for memcmp on fixed memory location Date: Sun, 12 Sep 2021 09:01:48 -0700 Message-Id: <20210912160149.2227137-4-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210912160149.2227137-1-linux@roeck-us.net> References: <20210912160149.2227137-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org parisc:allmodconfig fails to build with the following error when using gcc 11.x. arch/parisc/kernel/setup.c: In function 'start_parisc': arch/parisc/kernel/setup.c:389:28: error: '__builtin_memcmp_eq' specified bound 8 exceeds source size 0 Avoid the problem by using absolute_pointer() when providing a memory address to memcmp(). Signed-off-by: Guenter Roeck Signed-off-by: Helge Deller --- arch/parisc/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index cceb09855e03..4e13345b6581 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c @@ -384,7 +384,7 @@ void __init start_parisc(void) struct pdc_coproc_cfg coproc_cfg; /* check QEMU/SeaBIOS marker in PAGE0 */ - running_on_qemu = (memcmp(&PAGE0->pad0, "SeaBIOS", 8) == 0); + running_on_qemu = (memcmp(absolute_pointer(&PAGE0->pad0), "SeaBIOS", 8) == 0); cpunum = smp_processor_id(); From patchwork Sun Sep 12 16:01:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 12486951 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 AE36BC433F5 for ; Sun, 12 Sep 2021 16:02:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9421460F4A for ; Sun, 12 Sep 2021 16:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236123AbhILQDb (ORCPT ); Sun, 12 Sep 2021 12:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236022AbhILQDV (ORCPT ); Sun, 12 Sep 2021 12:03:21 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515F3C0613D8; Sun, 12 Sep 2021 09:02:03 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id bd1so10763730oib.5; Sun, 12 Sep 2021 09:02:03 -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=k7vOSXJvuBFedGqEmsc9y4fLwgAcNpSGF+uyNF/6Rc4=; b=GVTomCds0oHSZwZ+CTeT02sfHZ+uX8vQBFkmUFHVSBVMyoMK1poVF7DH8H5r1UYFRK aPCLOAbhNTN0Pf73m3EnkBCGrCx8Sz8mfm4fpr03P50xQCkmjPnx6H1fMBfR8TXi2yql 7EpXjBZQjVBhuRLjaeIAzrOfigBrZLiN1cMRentTn0+/xh9NknH0Wl8VZJEOKW2wEAbz cLq7gUjvQS/t3euFq+3g8iDOzvLSyu8Sijmu75+aIQRni0rJJTrPiWLF1zYZ7e0lMEjv TCPoA1bHoUyY94AnRaVage1SFWbZ2fb2dbI3Hl/OEyUsEJ3gyUrP6RZBCknb7+wWO1mY VqZQ== 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=k7vOSXJvuBFedGqEmsc9y4fLwgAcNpSGF+uyNF/6Rc4=; b=WS2tJITiLSR5jdYu9qbSAHAIcbycQfiWLVmlBoryw9sa3DTwlencz1lfn3ySQawgP+ dyYAKCJ0kvmvZ6fTJ29EKQ08kfd8vMGO5DmfRKhB97jtSLSWzI3MkMJTFJPZlrnzU7wK gUKLCrxDuLJ10A/ThiyIKHCOMonl4vBVItq+YpP9BtJ//ydHymWnSzRoJy+iXnTWAbpD rSikyl7BBLUjDgM9HgUVHOXp0Sv3o7BKFVzXXotK+0Nd0eA03qlByUu0e5Ym2iaObXrz kjbba8gUwkEGnJrPLMjFooyP9iRWs0j/P253O6t5f1hpV1SoBH0RVuBSyBWi5MB5Gt89 spWg== X-Gm-Message-State: AOAM531ciwSOECCpjocAT1rXbghXqrWa9loaiEjx9BVOD67Z9X7Gp7jX NQXtWsR35mhzRPZiIPcW37Q= X-Google-Smtp-Source: ABdhPJxb1VPXMwcXDAB2MTnc8E2tBnOL9N7CU6cFnuCzUVgrOk+LibtThqzlA+vv5VXasU/DM9aWpA== X-Received: by 2002:a05:6808:2cd:: with SMTP id a13mr5006585oid.3.1631462522711; Sun, 12 Sep 2021 09:02:02 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z1sm1202256ooj.25.2021.09.12.09.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 09:02:02 -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 4/4] alpha: Use absolute_pointer for strcmp on fixed memory location Date: Sun, 12 Sep 2021 09:01:49 -0700 Message-Id: <20210912160149.2227137-5-linux@roeck-us.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210912160149.2227137-1-linux@roeck-us.net> References: <20210912160149.2227137-1-linux@roeck-us.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org alpha:allmodconfig fails to build with the following error when using gcc 11.x. arch/alpha/kernel/setup.c: In function 'setup_arch': arch/alpha/kernel/setup.c:493:13: error: 'strcmp' reading 1 or more bytes from a region of size 0 Avoid the problem by using absolute_pointer() when providing a memory address to strcmp(). Signed-off-by: Guenter Roeck --- arch/alpha/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index b4fbbba30aa2..aab477a76c30 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -490,7 +490,7 @@ setup_arch(char **cmdline_p) /* Hack for Jensen... since we're restricted to 8 or 16 chars for boot flags depending on the boot mode, we need some shorthand. This should do for installation. */ - if (strcmp(COMMAND_LINE, "INSTALL") == 0) { + if (strcmp(absolute_pointer(COMMAND_LINE), "INSTALL") == 0) { strlcpy(command_line, "root=/dev/fd0 load_ramdisk=1", sizeof command_line); } else { strlcpy(command_line, COMMAND_LINE, sizeof command_line);