From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB5A4C77B61 for ; Thu, 27 Apr 2023 17:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244479AbjD0RmW (ORCPT ); Thu, 27 Apr 2023 13:42:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244389AbjD0RmL (ORCPT ); Thu, 27 Apr 2023 13:42:11 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D52F19F for ; Thu, 27 Apr 2023 10:41:59 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id 4F94A21C33E1; Thu, 27 Apr 2023 10:41:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4F94A21C33E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617318; bh=XSS94wog701zQLpD7y0CmSI6sjOskvST2v9WTZpXSuw=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=KC6ZwgtqC9euOjJ5w0tehDfyKXGSp1Mqj6NgboJFVNtYflzT8mCJPM/l4lIbnzDGk p7DdAzi8m//mycqsRrgF/e3gc9kFS0xufP0H+9XvT9HkhLJ7sT7OYTTkOt5qFxYMCw uvRl10ZdIMspxR6L3Q5lEKo4Pl6ssgQhmuAqRTq0= Subject: [PATCH 1/7] x86: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Geert Uytterhoeven , Arnd Bergmann , Chris Down , Helge Deller , Omar Sandoval , linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:25 -0700 Message-ID: <168155744546.13678.7653611641170146532.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These two helper functions - virt_to_phys and isa_virt_to_bus - don't need = the address pointer to be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98virt_to_phys=E2=80=99 discards = =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Thomas Gleixner CC: Ingo Molnar CC: Borislav Petkov CC: Dave Hansen CC: x86@kernel.org CC: "H. Peter Anvin" CC: Geert Uytterhoeven CC: Arnd Bergmann CC: Chris Down CC: Helge Deller CC: Omar Sandoval CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- arch/x86/include/asm/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index e9025640f634..0e6f5b48f517 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -128,7 +128,7 @@ extern int valid_mmap_phys_addr_range(unsigned long pfn= , size_t size); * this function */ =20 -static inline phys_addr_t virt_to_phys(volatile void *address) +static inline phys_addr_t virt_to_phys(const volatile void *address) { return __pa(address); } @@ -163,7 +163,7 @@ static inline void *phys_to_virt(phys_addr_t address) * However, we truncate the address to unsigned int to avoid undesirable * promotions in legacy drivers. */ -static inline unsigned int isa_virt_to_bus(volatile void *address) +static inline unsigned int isa_virt_to_bus(const volatile void *address) { return (unsigned int)virt_to_phys(address); } From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 903F2C77B73 for ; Thu, 27 Apr 2023 17:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244506AbjD0Rm0 (ORCPT ); Thu, 27 Apr 2023 13:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244449AbjD0RmS (ORCPT ); Thu, 27 Apr 2023 13:42:18 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B40EA3584; Thu, 27 Apr 2023 10:42:04 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id 1256821C33E2; Thu, 27 Apr 2023 10:42:04 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1256821C33E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617324; bh=y5FKETkcR5bJeA05EuMUf08/uW3fzemI0xL6hftJZ0w=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=I81ONq4flDFybAHDmcdEBwB18AgoI8OINU6R4Az6WvVIVzocvmY/pieHzLajTdhKo HA0Dp+jT2ScUGmry+Oi6xup26Stlv/BVUUj8EZqzcf+c26o+ieBPHo+PXorzzsW/Y4 ltVQ+ERLydTb/l5zHlX3TcVCAlUq35bKUAjZ5cSk= Subject: [PATCH 2/7] alpha: asm/io.h: Expect immutable pointer in virt_to_phys/isa_virt_to_bus prototypes From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Richard Henderson , Ivan Kokshaysky , Matt Turner , Arnd Bergmann , Geert Uytterhoeven , Linus Walleij , Stanislav Kinsburskii , Michael Ellerman , Bjorn Helgaas , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:31 -0700 Message-ID: <168155745118.13678.3878958755096151716.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These two helper functions - virt_to_phys and isa_virt_to_bus - don't need = the address pointer to be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98virt_to_phys=E2=80=99 discards = =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner CC: Arnd Bergmann CC: Geert Uytterhoeven CC: Linus Walleij CC: Stanislav Kinsburskii CC: Michael Ellerman CC: Bjorn Helgaas CC: linux-alpha@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- arch/alpha/include/asm/io.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index 7aeaf7c30a6f..0e2016537bd3 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -56,7 +56,7 @@ extern inline void set_hae(unsigned long new_hae) * Change virtual addresses to physical addresses and vv. */ #ifdef USE_48_BIT_KSEG -static inline unsigned long virt_to_phys(volatile void *address) +static inline unsigned long virt_to_phys(const volatile void *address) { return (unsigned long)address - IDENT_ADDR; } @@ -66,7 +66,7 @@ static inline void * phys_to_virt(unsigned long address) return (void *) (address + IDENT_ADDR); } #else -static inline unsigned long virt_to_phys(volatile void *address) +static inline unsigned long virt_to_phys(const volatile void *address) { unsigned long phys =3D (unsigned long)address; =20 @@ -104,7 +104,7 @@ static inline void * phys_to_virt(unsigned long address) extern unsigned long __direct_map_base; extern unsigned long __direct_map_size; =20 -static inline unsigned long __deprecated isa_virt_to_bus(volatile void *ad= dress) +static inline unsigned long __deprecated isa_virt_to_bus(const volatile vo= id *address) { unsigned long phys =3D virt_to_phys(address); unsigned long bus =3D phys + __direct_map_base; From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF1D5C77B7E for ; Thu, 27 Apr 2023 17:42:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244508AbjD0Rmi (ORCPT ); Thu, 27 Apr 2023 13:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244443AbjD0RmX (ORCPT ); Thu, 27 Apr 2023 13:42:23 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B93F49EF; Thu, 27 Apr 2023 10:42:10 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id E386621C33E3; Thu, 27 Apr 2023 10:42:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E386621C33E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617330; bh=s/kg+M27AkKVchwO9jCgPJL2Mpa/KAVUq2YWw+ZkhKA=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=HfdRi3nzr4I30thtNMUKY+2hg4LdPCEOftLVmSIa9WFvZT7qpe3uvR+IGqMSclfGz gQ6zKnodlgKFmd1DSYQWaUhwWFKPOvwgQUdF3CR0NtPrD7+LL+KUNDJZj1g9A09vOk Tc5eIwLJOdC7DmIOAZ/lAguWRahJQlVTyF76HQO4= Subject: [PATCH 3/7] mips: asm/io.h: Expect immutable pointer in isa_virt_to_bus prototype From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Thomas Bogendoerfer , Geert Uytterhoeven , Michael Ellerman , Florian Fainelli , Arnd Bergmann , Stanislav Kinsburskii , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:36 -0700 Message-ID: <168155745691.13678.14513434425435520788.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These helper function - isa_virt_to_bus - doesn't need the address pointer = to be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98isa_virt_to_bus=E2=80=99 discards= =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Thomas Bogendoerfer CC: Geert Uytterhoeven CC: Michael Ellerman CC: Florian Fainelli CC: Arnd Bergmann CC: Stanislav Kinsburskii CC: Jiaxun Yang CC: linux-mips@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- arch/mips/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index cc28d207a061..d78ca2e71f8c 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -137,7 +137,7 @@ static inline void * phys_to_virt(unsigned long address) /* * ISA I/O bus memory addresses are 1:1 with the physical address. */ -static inline unsigned long isa_virt_to_bus(volatile void *address) +static inline unsigned long isa_virt_to_bus(const volatile void *address) { return virt_to_phys(address); } From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8AB9C77B73 for ; Thu, 27 Apr 2023 17:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244598AbjD0Rmq (ORCPT ); Thu, 27 Apr 2023 13:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244519AbjD0Rmd (ORCPT ); Thu, 27 Apr 2023 13:42:33 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 252565599; Thu, 27 Apr 2023 10:42:16 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id 8806821C33E1; Thu, 27 Apr 2023 10:42:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8806821C33E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617335; bh=sj6LPYNvymIeZEc3MyNCG2Y2lTHGTHDS4BHT1bAwr3Y=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=Z63G6khxN1OPq0ZG7hjZeqCgnQ5dGb2R4fM1LshMq7Ib3jI0XzV9Hjp1g+/hL2TBe 1B3HjnIiQHcC967R9SnMk6mY1Jtmh8zcJ2gIhGAwmINGBN2VpJODCf0+HD1hue4DwR NMtoUFf36vlRNMFGNZ1dUod0jepQDsbhlr+RbQ2o= Subject: [PATCH 4/7] hexagon: asm/io.h: Expect immutable pointer in virt_to_phys prototype From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Brian Cain , Linus Walleij , Mark Brown , linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:42 -0700 Message-ID: <168155746272.13678.16103862954212080276.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These helper function - virt_to_phys - doesn't need the address pointer to be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98virt_to_phys=E2=80=99 discards = =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Brian Cain CC: Linus Walleij CC: Mark Brown CC: linux-hexagon@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- arch/hexagon/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h index 46a099de85b7..facbd7467dd3 100644 --- a/arch/hexagon/include/asm/io.h +++ b/arch/hexagon/include/asm/io.h @@ -46,7 +46,7 @@ extern void __raw_writesl(void __iomem *addr, const void = *data, int wordlen); * virt_to_phys - map virtual address to physical * @address: address to map */ -static inline unsigned long virt_to_phys(volatile void *address) +static inline unsigned long virt_to_phys(const volatile void *address) { return __pa(address); } From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3184C77B73 for ; Thu, 27 Apr 2023 17:42:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244482AbjD0Rmw (ORCPT ); Thu, 27 Apr 2023 13:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244536AbjD0Rmf (ORCPT ); Thu, 27 Apr 2023 13:42:35 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2A5955AD; Thu, 27 Apr 2023 10:42:21 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id 2486921C33E2; Thu, 27 Apr 2023 10:42:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2486921C33E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617341; bh=UW7ul1bnDEkuT8AVHX2Onz8R55uQ/uJg/sKB3VFIxA8=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=GliyQuKW8oGgjFC+cLdORseF/SjeucGpIWTeHmMqR/KK+I4hETWbTsw1knbYRh+ZR MAUHxIEfXAJKc+C+mHa5zeINLp0UrkYuhHWGUcDUmjK65ZhaWGnbgn4HjG5NdbtxYG zPBjIck4JhL804V8kj1f5FBRY43HMXKgC5GxUAzs= Subject: [PATCH 5/7] ia64: asm/io.h: Expect immutable pointer in virt_to_phys prototype From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Geert Uytterhoeven , Helge Deller , Arnd Bergmann , Andrew Morton , Bjorn Helgaas , Stanislav Kinsburskii , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:48 -0700 Message-ID: <168155746830.13678.8071954787135972276.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These helper function - virt_to_phys - doesn't need the address pointer to be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98virt_to_phys=E2=80=99 discards = =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Geert Uytterhoeven CC: Helge Deller CC: Arnd Bergmann CC: Andrew Morton CC: Bjorn Helgaas CC: Stanislav Kinsburskii CC: linux-ia64@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- arch/ia64/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h index 83a492c8d298..c56ad21ba1e9 100644 --- a/arch/ia64/include/asm/io.h +++ b/arch/ia64/include/asm/io.h @@ -74,7 +74,7 @@ extern unsigned int num_io_spaces; * Change virtual addresses to physical addresses and vv. */ static inline unsigned long -virt_to_phys (volatile void *address) +virt_to_phys (const volatile void *address) { return (unsigned long) address - PAGE_OFFSET; } From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC50FC77B61 for ; Thu, 27 Apr 2023 17:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244581AbjD0RnG (ORCPT ); Thu, 27 Apr 2023 13:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244575AbjD0Rmh (ORCPT ); Thu, 27 Apr 2023 13:42:37 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 64E76449A for ; Thu, 27 Apr 2023 10:42:27 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id BE5D621C33DF; Thu, 27 Apr 2023 10:42:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BE5D621C33DF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617346; bh=lbHi5s+Eft8kCcVZxoCtTZ7X0binDj0JHmqe0h+9dEs=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=OzkmcOKuax2YnA3bhoej74/6EDZuvfZ0Inv7NG/hTtmTtzHerkqwO1WE2jzjkssq6 RFiLLepRAcL1SMfIEGdWinCDvpJfwr2hWfpxojZMTXR6mzZ7ogYovV8C8OeeB1lfQu HyWtbtNrXC+BzfVMUO9Yj8zBeTY/z9GWcsc0nnJI= Subject: [PATCH 6/7] powerpc: asm/io.h: Expect immutable pointer in virt_to_phys prototype From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Geert Uytterhoeven , Bjorn Helgaas , Stanislav Kinsburskii , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:53 -0700 Message-ID: <168155747391.13678.10634415747614468991.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These helper function - virt_to_phys - doesn't need the address pointer to be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98virt_to_phys=E2=80=99 discards = =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Michael Ellerman CC: Nicholas Piggin CC: Christophe Leroy CC: Geert Uytterhoeven CC: Bjorn Helgaas CC: Stanislav Kinsburskii CC: Arnd Bergmann CC: linuxppc-dev@lists.ozlabs.org CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- arch/powerpc/include/asm/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index f1e657c9bbe8..c287eeb9536f 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -959,7 +959,7 @@ extern void __iomem *__ioremap_caller(phys_addr_t, unsi= gned long size, * almost all conceivable cases a device driver should not be using * this function */ -static inline unsigned long virt_to_phys(volatile void * address) +static inline unsigned long virt_to_phys(const volatile void * address) { WARN_ON(IS_ENABLED(CONFIG_DEBUG_VIRTUAL) && !virt_addr_valid(address)); =20 From nobody Thu Dec 18 07:56:51 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CFE2C77B73 for ; Thu, 27 Apr 2023 17:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244606AbjD0RnK (ORCPT ); Thu, 27 Apr 2023 13:43:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244608AbjD0Rmq (ORCPT ); Thu, 27 Apr 2023 13:42:46 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46D515FE5; Thu, 27 Apr 2023 10:42:33 -0700 (PDT) Received: from skinsburskii.localdomain (c-67-170-100-148.hsd1.wa.comcast.net [67.170.100.148]) by linux.microsoft.com (Postfix) with ESMTPSA id 590A721C33E1; Thu, 27 Apr 2023 10:42:32 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 590A721C33E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682617352; bh=JzW52Omm51Pbk9wjpjdqd20u4BkUZE5fIgVHo4czr6g=; h=Subject:From:Cc:Date:In-Reply-To:References:From; b=Ndu3v4Nv6DdxwdMWwYXsIdVK+/OKKnSlFxnwYRe5+4vYuhKkWuJa3H3ajz/keSZhL D9a//NBRM2gcEk/I1HTmQkqamXjCSkcS5/SjaAspvmoXWzVWrxPI/s1rau7sJ/cw7J VsYOBppFTptB2s2cZoejMUuCHM/XbqmID3JzPnl8= Subject: [PATCH 7/7] asm-generic/io.h: Expect immutable pointer in virt_to_phys From: Stanislav Kinsburskii Cc: Stanislav Kinsburskii , Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 15 Apr 2023 04:17:59 -0700 Message-ID: <168155747955.13678.5648956145924030241.stgit@skinsburskii.localdomain> In-Reply-To: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> References: <168155718437.13678.714141668943813263.stgit@skinsburskii.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanislav Kinsburskii These helper function - virt_to_phys - doesn't need the address pointer to = be mutable. In the same time expecting it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of =E2=80=98virt_to_phys=E2=80=99 discards = =E2=80=98const=E2=80=99 qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii CC: Arnd Bergmann CC: linux-arch@vger.kernel.org CC: linux-kernel@vger.kernel.org Reviewed-by: Linus Walleij --- include/asm-generic/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 587e7e9b9a37..ee9d9584e05b 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -1000,7 +1000,7 @@ static inline void iowrite64_rep(volatile void __iome= m *addr, */ #ifndef virt_to_phys #define virt_to_phys virt_to_phys -static inline unsigned long virt_to_phys(volatile void *address) +static inline unsigned long virt_to_phys(const volatile void *address) { return __pa((unsigned long)address); }