Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp990740rwr; Thu, 27 Apr 2023 10:42:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6J14QlTXdgEOPYp0b/WbnXlZ7evOc4QbPNGX6juunEP9XYk0Abx4fyp4ZVCrcr8AvC39ix X-Received: by 2002:a05:6a20:7491:b0:f6:d60d:dbfc with SMTP id p17-20020a056a20749100b000f6d60ddbfcmr3090719pzd.5.1682617368963; Thu, 27 Apr 2023 10:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682617368; cv=none; d=google.com; s=arc-20160816; b=e2Etry6/jDfI1r1H4uXjxo3Gfz9covVTLz6p3OA1cMGRvhHxE8WKwAwjAoegg9wNdG At13yhlFUkKhavPNdwYV0GhqQ566kLv5ujUhKFDgVFgRFnFJYa10iKPNorFN91V/bGal 0fb5+btQfHLHs6zuMnOJWCnf5qWGyvfjirdlsmy3wr5lbjiOU4XzQzhdpBbaYjFrTopN ScYpyDdTOMSoyBKbvNEMS0fw21VdU5XwycsRHHtkL6EaP0RVK2yzFNt69KID8YxTsYBp ypgT4YeCKgpGQObmD6qQE/l//q0rxhPju/aKdpWKIac2/YhmiqaBVVLiqZLIezBEb+yW ksjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:from:subject :dkim-signature:dkim-filter; bh=XSS94wog701zQLpD7y0CmSI6sjOskvST2v9WTZpXSuw=; b=p7zzBJ8M66CIRHBfHe+qeLLOEXlCHe6tylz02imhZk+n1RQnBcda8N1TldM2vMuehp 8MTkuURMrnFZKJgyVLVp4JOck1ZNdEs+PGAKVOQKNrGtoGoOP8YY4/RMbatwEJ+I/9fp nS5Y4Js5jmsaRwi2V44VLoteQbs1BLayg+R1ZeuCDT2e/782YzcmgcsY6vxlfm1KVGA2 kmNfS1QmRj0Hj7zP1dqf0rOKUfHFKfR1dJRofKyILGRoda6cght/fzEE184dQLF+3NrH IC8UNwWmuWzR67FIkWj520mVLWbHadm+w6qQfqv6e9AyK1oAvPHQwn+dcvsvguwtsdgR vTXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=KC6Zwgtq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a631553000000b0050f79f0651fsi19454194pgv.95.2023.04.27.10.42.35; Thu, 27 Apr 2023 10:42:48 -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=@linux.microsoft.com header.s=default header.b=KC6Zwgtq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244462AbjD0RmU (ORCPT + 99 others); Thu, 27 Apr 2023 13:42:20 -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: 8bit X-Spam-Status: No, score=-15.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_96_XX, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH, MISSING_HEADERS,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 ‘virt_to_phys’ discards ‘const’ 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 --- 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 */ -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); }