From patchwork Sat Apr 15 11:17:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stanislav Kinsburskii X-Patchwork-Id: 88331 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp433160vqo; Thu, 27 Apr 2023 10:46:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76pj7fjhxQ9QFIzqwtEWp/B1X3Lv+/e99hJGzwK0iYWqqFE+hM41LV1PEUCqgUgPaCCabN X-Received: by 2002:a17:90a:fb53:b0:240:7f0d:9235 with SMTP id iq19-20020a17090afb5300b002407f0d9235mr2617860pjb.22.1682617563234; Thu, 27 Apr 2023 10:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682617563; cv=none; d=google.com; s=arc-20160816; b=PJx4C3/dVVSpBMJa0TU5P0awegF4qrE8TMdX02L473FCSaq9D29b9OF9nzc3PVcj9I 8jDiDZJswnIpdCHxnBuR23x9dXJAq6upfuO+LlqU8JQ+sHJsLGGrfpyrwewji3OM7VAm eB4Wfn/f1Q0r8cNcN8rWV87WaBrkxu359X2pJVHAMFwLEoGau0arR/jZGZJJSioq27/G YTUP4ebmLwNy2jfxMlclwTEb26JdyDrQqLzRGcCCSELHIGpad+VuekVyVibDltzkCPJT 5YRAyinBPGVK+hdCQYB11onq+fQ4txdfeQI6LDki01HfxR7C0jstK9H/7Q2kDVQHblFv qIdQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y62-20020a638a41000000b005203991145csi19941253pgd.623.2023.04.27.10.45.48; Thu, 27 Apr 2023 10:46:03 -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 S244472AbjD0RmV (ORCPT + 99 others); Thu, 27 Apr 2023 13:42:21 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764352394302780548?= X-GMAIL-MSGID: =?utf-8?q?1764352394302780548?= 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); }