Message ID | 20230724100346.1302937-1-sunilvl@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1706354vqg; Mon, 24 Jul 2023 03:34:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhLKFIO+lmEr/p3Th8b2hyEcm5V6oxJbPSv3LDP3k+f/AzxHtaalTRUYL78hqBcM6RBIMu X-Received: by 2002:a19:5209:0:b0:4fa:21d5:c0a3 with SMTP id m9-20020a195209000000b004fa21d5c0a3mr4655945lfb.36.1690194872675; Mon, 24 Jul 2023 03:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690194872; cv=none; d=google.com; s=arc-20160816; b=tUKaIB0sjfd2hKZ/qkshIUk3ezbHotxcBXfiOlQZ6EKs8PCnElf1fo5ZXR4VU/pmV0 noM8A55aAW5pbDYFvLeqYOHoXPyRD6XJDTmruMH9pJFoCzC8ypsxum7XLjg51Aek25Dl IX75alXBbyWaCr49YtcBhT1K+QyeL/oa2m43/MyIvTCH71vcwPXPs7tkMdOzRKpRq/Fh aN4G11GAYbFjoJtR+aw05u3qO+z/2oV2esk69Pz5SnpPAoCRLHHXC9tx9ey6K4SZhAzy 3JoAkg+T8aQpT8/m7eWapSRv5fGGuF+2MfjB64XkWim9/fiXw1Emky6XyKoDgZScAEXb 4qQA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=UUcCkSTwYLiD/t1kcQ5bDbSt1mwTfBpcBGNsDxfuBOA=; fh=bKq58Q1fTORvr7XzrLw/Gaej7DfUpSShbqNQVpqVsKo=; b=t5dBaT1fc0V+o1Emwl55xz1ho+pJQIOYy/8aKkJClnkZfkrsdwMSH+cIEERHTl/EmO UyPxGwXGFxZpTcd/U3za2BnxUD6XBft4g/EvZ7QBl1o+zOPUWzm/56Rc1UDderqE5f3U SBUGJQIcV4WaySZ5RViLx8U1jfInyfFZQwSsAKfFzCnI2zyv2Mc9iDFLcFJ/sCIdsAlb 5WVRyAi7jPF10zl0zkBcJ5bdKxYXn3j5vdhilcv0FA+SYL25CGSZhDnwHSl+t1czVAXZ E0rOhQ7q/YmpJrlW1pAO0bp62jCW7/9WEHroZOa//AL0FPwl1OznM7jUkNc0cxzi5MaD ttlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="CNwx/jLm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020aa7d447000000b00521dd32056csi6109685edr.487.2023.07.24.03.34.07; Mon, 24 Jul 2023 03:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="CNwx/jLm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233236AbjGXKMG (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 24 Jul 2023 06:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231866AbjGXKLq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Jul 2023 06:11:46 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC8D959F3 for <linux-kernel@vger.kernel.org>; Mon, 24 Jul 2023 03:04:27 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-666e916b880so2302060b3a.2 for <linux-kernel@vger.kernel.org>; Mon, 24 Jul 2023 03:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1690193032; x=1690797832; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UUcCkSTwYLiD/t1kcQ5bDbSt1mwTfBpcBGNsDxfuBOA=; b=CNwx/jLmX1kzvaYEGA/thpQvQrezMQ734fYSg9UAAm6yofFqIEpkSVs/+WHZxynyl2 Vk5PFfX0aoJHpDT1WSh2FCbYNS80FR1zvpg9Hg6ZufKE2ymwsc4/zCvYErKQsLCNn7Ug jAT8y4mbv+syB/ElAFiNUUiItdQdWpKw++rdUy7g6l/G5og8eJf5/OoNKyRUl126Rz3b Y90AEXS9SwLiC/i5KoxCrCwfEN0/+GBzo5QUtk+bYLFUDshvh4GM6Q1zeoAd/jUNnSrB uSzkC6GecKY8I09698ymosvxd53FxBz0BKxSNBmLzMk9pbEPCaf5Pb/ZJASRb40Lbkx6 A0wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690193032; x=1690797832; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UUcCkSTwYLiD/t1kcQ5bDbSt1mwTfBpcBGNsDxfuBOA=; b=kKoAndRUm4ELbulE6i/63k1jdrsG/e4W7hLpiwh3yHmQ8CtDpM42T5tYyFEFWBKKcb +Q1zAivmEYFzKL9Rzme5+94x17kiH4snJTob19fMjAPOaga+FMiqoF43iTcQuFxySI06 ZlO0Ypt5OM87d8oUrBAFtFS7xMfylCz91qo8WqgII2gqkQvu9D+w0rFGgHpwagB72qkv cDx3CrrpG2Yosj8sVbKrqJSQVaMOEAvR/tOyBCs6KFB0HZufPLVRbXyvHYBjRChuxGL1 XqKz7vf/iJpZstTEkwcqG6fWmupf/9S8F5kqexDfClHR6eh2d/QbbRcHRHQl8+SfP8yz 9rEg== X-Gm-Message-State: ABy/qLYnCcGASmr89t4VpcvWT8/2cQindnofaWiwaWDWV7bsh2xcKqT/ OHJyIWylv+r7isJBWvFZzhz1pQ== X-Received: by 2002:a05:6a20:a11b:b0:134:d8e6:2717 with SMTP id q27-20020a056a20a11b00b00134d8e62717mr8724991pzk.47.1690193032051; Mon, 24 Jul 2023 03:03:52 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.190.25]) by smtp.gmail.com with ESMTPSA id l12-20020a62be0c000000b0067459e92801sm7344789pff.64.2023.07.24.03.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 03:03:51 -0700 (PDT) From: Sunil V L <sunilvl@ventanamicro.com> To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Conor Dooley <conor.dooley@microchip.com>, Andrew Jones <ajones@ventanamicro.com>, Sunil V L <sunilvl@ventanamicro.com>, kernel test robot <lkp@intel.com> Subject: [PATCH v3 -fixes] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address Date: Mon, 24 Jul 2023 15:33:46 +0530 Message-Id: <20230724100346.1302937-1-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772297778718389875 X-GMAIL-MSGID: 1772297778718389875 |
Series |
[v3,-fixes] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address
|
|
Commit Message
Sunil V L
July 24, 2023, 10:03 a.m. UTC
acpi_os_ioremap() currently is a wrapper to memremap() on
RISC-V. But the callers of acpi_os_ioremap() expect it to
return __iomem address and hence sparse tool reports a new
warning. Fix this issue by type casting to __iomem type.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/
Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
---
Changes since v2:
1) Removed unnecessary __force.
2) Removed unnecessary space after cast to fix checkpatch --strict warning.
Changes since v1:
1) Removed enhancements from the fix patch.
arch/riscv/include/asm/acpi.h | 2 +-
arch/riscv/kernel/acpi.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Comments
On Mon, Jul 24, 2023 at 03:33:46PM +0530, Sunil V L wrote: > acpi_os_ioremap() currently is a wrapper to memremap() on > RISC-V. But the callers of acpi_os_ioremap() expect it to > return __iomem address and hence sparse tool reports a new > warning. Fix this issue by type casting to __iomem type. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/ > Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core") > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > --- Surprisingly, my automation already tested this patch. Usually there's a several hour delay between posting & testing. Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks, Conor. > Changes since v2: > 1) Removed unnecessary __force. > 2) Removed unnecessary space after cast to fix checkpatch --strict warning. > > Changes since v1: > 1) Removed enhancements from the fix patch. > > arch/riscv/include/asm/acpi.h | 2 +- > arch/riscv/kernel/acpi.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h > index f71ce21ff684..d5604d2073bc 100644 > --- a/arch/riscv/include/asm/acpi.h > +++ b/arch/riscv/include/asm/acpi.h > @@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t; > #define PHYS_CPUID_INVALID INVALID_HARTID > > /* ACPI table mapping after acpi_permanent_mmap is set */ > -void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); > +void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); > #define acpi_os_ioremap acpi_os_ioremap > > #define acpi_strict 1 /* No out-of-spec workarounds on RISC-V */ > diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c > index 5ee03ebab80e..56cb2c986c48 100644 > --- a/arch/riscv/kernel/acpi.c > +++ b/arch/riscv/kernel/acpi.c > @@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size) > early_iounmap(map, size); > } > > -void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) > +void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) > { > - return memremap(phys, size, MEMREMAP_WB); > + return (void __iomem *)memremap(phys, size, MEMREMAP_WB); > } > > #ifdef CONFIG_PCI > -- > 2.39.2 >
On Mon, 24 Jul 2023 15:33:46 +0530, Sunil V L wrote: > acpi_os_ioremap() currently is a wrapper to memremap() on > RISC-V. But the callers of acpi_os_ioremap() expect it to > return __iomem address and hence sparse tool reports a new > warning. Fix this issue by type casting to __iomem type. > > Applied, thanks! [1/1] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address https://git.kernel.org/palmer/c/568701fee366 Best regards,
Hello: This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <palmer@rivosinc.com>: On Mon, 24 Jul 2023 15:33:46 +0530 you wrote: > acpi_os_ioremap() currently is a wrapper to memremap() on > RISC-V. But the callers of acpi_os_ioremap() expect it to > return __iomem address and hence sparse tool reports a new > warning. Fix this issue by type casting to __iomem type. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/ > Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core") > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > > [...] Here is the summary with links: - [v3,-fixes] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address https://git.kernel.org/riscv/c/568701fee366 You are awesome, thank you!
diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h index f71ce21ff684..d5604d2073bc 100644 --- a/arch/riscv/include/asm/acpi.h +++ b/arch/riscv/include/asm/acpi.h @@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t; #define PHYS_CPUID_INVALID INVALID_HARTID /* ACPI table mapping after acpi_permanent_mmap is set */ -void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); +void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); #define acpi_os_ioremap acpi_os_ioremap #define acpi_strict 1 /* No out-of-spec workarounds on RISC-V */ diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c index 5ee03ebab80e..56cb2c986c48 100644 --- a/arch/riscv/kernel/acpi.c +++ b/arch/riscv/kernel/acpi.c @@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size) early_iounmap(map, size); } -void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) +void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) { - return memremap(phys, size, MEMREMAP_WB); + return (void __iomem *)memremap(phys, size, MEMREMAP_WB); } #ifdef CONFIG_PCI