From patchwork Sat Apr 15 11:17:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stanislav Kinsburskii X-Patchwork-Id: 88336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp433678vqo; Thu, 27 Apr 2023 10:47:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xx24O95FiGrukfRLadJeW/h47NZdI2DNcmkkUVb1kf4fqPHKpL8evBfkyAhQHAgsed+bS X-Received: by 2002:a17:902:c949:b0:1a6:9d1b:e18f with SMTP id i9-20020a170902c94900b001a69d1be18fmr2740593pla.45.1682617636520; Thu, 27 Apr 2023 10:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682617636; cv=none; d=google.com; s=arc-20160816; b=uxtf6vha6x2/V7lTqy7LdyLglWnlRQ8D6Yd0ETwaEhJYgA36JHGmaQpQfr3jBio40T FQp+fmVnp8V+p1G09J7mb6QBKmKSdD8jnFXAU/NFecFEPmgmMWbkCJLZOWEnpP3EJCOC CQdxaDw4XIGi8VFddtCgfhckf4DlJkS4vLR3YcUwtTAbKiSruXq0xh97RZegFAro4PEG OwQyuniX9nNaBZVSX85xju4vwl33mNZogZkPUaaZSwaN4VJjuKYrTl78AvrWJpvvY81+ qj1MnlAAgvgbXMpi/K2UFnycKBbapVIkVO2fsvik3mo7GcYnI3EBlWXpPtWJeH4SI5Ag my+A== 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=y5FKETkcR5bJeA05EuMUf08/uW3fzemI0xL6hftJZ0w=; b=GMJNNJfGd4Lt7gLHjzcGE5w54fEOPMH2NKv2c45XuRIws8t76aAD/+r3SAyZcGVChC CQM/5vC3lIluGwgaDSibFlhjUoX3pu+XZqW8z1qZRnjcbnExJ11hMenVSnt5eU/GItkV oLMMMHymhuMN5M7bAhnrSQ9aY/3WJB5lr9Cpb/KoI4b4v2igRAc5nv6LLOSowYeLfUyJ fcOyY0t9Cnpbi3bvWMs99P8upCc/fyrf5YvzqL/pDdE8kIAgnac2rrog+Tq0kUxESeFv Gv/C5YXHGZ+LYoHeY0UMgQwe41m1PPA3SHk/h2qAEkrGTSYgqBJxyfaR2EhNmMGQf9/K 8kgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=I81ONq4f; 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 j13-20020a170903024d00b001a50a33295esi21269639plh.278.2023.04.27.10.47.00; Thu, 27 Apr 2023 10:47:16 -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=I81ONq4f; 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 S244504AbjD0Rm0 (ORCPT + 99 others); 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 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?1764352470939965144?= X-GMAIL-MSGID: =?utf-8?q?1764352470939965144?= 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: 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 --- 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 = (unsigned long)address; @@ -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; -static inline unsigned long __deprecated isa_virt_to_bus(volatile void *address) +static inline unsigned long __deprecated isa_virt_to_bus(const volatile void *address) { unsigned long phys = virt_to_phys(address); unsigned long bus = phys + __direct_map_base;