Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2423634rdb; Thu, 21 Sep 2023 19:57:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3fMGnO1Azt9cMAfztuZwB6B1VTg52XxVhm/GIWG7RyWvAaENIpzPCECsm20Sr7pR/L2Dh X-Received: by 2002:a05:6871:686:b0:1d5:f814:56a3 with SMTP id l6-20020a056871068600b001d5f81456a3mr8155767oao.2.1695351459719; Thu, 21 Sep 2023 19:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695351459; cv=none; d=google.com; s=arc-20160816; b=y0V2oDGJAsfQAOYiGxUrW6J3xoqAvp6ZmuBHM1FgudQpl0zNKp3zzs80HCPYEMNRTp euNEJLFtH/KadUZJbq9DjkptMXqniPiRoP97mqrdiwVI8JrtVWOWI6BN32OysS27TCYK MER1805jyvHGdOjDhMXS6mQAVAdrQaeE/FnRiJ119r8aNQ6yhuO6agZW6KwcQbJUe+12 PEDv944b6BcfqqeAr1ryUJzLVE8KeKTmrkQ/h8SGjniq8FHjvy9Z/kScBJOgQSJ9Cyhl 6uOjUojiRSPw6/dBYAtS3l4QHBzQYKOXw04jymYIzo7Y6aWhWw99xlc8Iqfx79yC7UfW 5ihA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+7t/BumSdqz7jYYtXcF1gDq2WFzlnypJrOD9JQD5AH8=; fh=phazDSlx4GfLqTlj/iRAvXA+VjurkiF+HGVIW6zbXFI=; b=irbyeZPL2lLz77JZd1vQHy+bYc+pvpdMxFRdXqYYBxU8bmvXuynQTYd8GUlmRYzsaH A/qErgDUEBHRFH1xN2sIMflaB+g3Zity32RsePfZ+sVsoqukWzReTrEsu8xEbie5+CMD LOvKqTMbIJHxBbi+lCrlOdkxb0E1KpuAvPpBFBE1C6NEpnH5G1iTZN6xPXrau3LJqGzy ogOOYhDztAe6a5E3HRFIZpAgeA5LfWfQo6uIRElDfKV5PlaP4RhbTObUnSQ+NC1XWinO IbHXYO7aJD7KWspLbKc3ZgpR38FIE1veiyhVplMvv/TGHKhHkg1AmaPP//mvWHE0mDzR ldhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ddmLtetu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id az1-20020a056a02004100b00565e42ba541si2849806pgb.482.2023.09.21.19.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 19:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ddmLtetu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E827C815D7F3; Thu, 21 Sep 2023 12:02:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbjIUTCL (ORCPT + 99 others); Thu, 21 Sep 2023 15:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbjIUTBh (ORCPT ); Thu, 21 Sep 2023 15:01:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE1E10DB for ; Thu, 21 Sep 2023 11:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695321268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+7t/BumSdqz7jYYtXcF1gDq2WFzlnypJrOD9JQD5AH8=; b=ddmLtetu1cmoK1eQm3I1+cSwYdUpErcpQsJOhaVfm2p+Virk7x+TJ2dGycKdOlPVi0ccmI FIJRuj+tWuc7ajTSTx94d3/zgvE8PleGKVlDvGOaIucS5kp6FhHav+MRqoScX0FEUHmNoE CVJit6aCJxT+y+FKg3XLqyKUX3/4+yM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-hGsr711MOhCa2r41Gebw6Q-1; Thu, 21 Sep 2023 07:05:04 -0400 X-MC-Unique: hGsr711MOhCa2r41Gebw6Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F25018175A1; Thu, 21 Sep 2023 11:05:03 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A8042156A27; Thu, 21 Sep 2023 11:04:56 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, arnd@arndb.de, jiaxun.yang@flygoat.com, mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org, tsbogend@alpha.franken.de, f.fainelli@gmail.com, deller@gmx.de, Baoquan He , Serge Semin , Huacai Chen , linux-mips@vger.kernel.org Subject: [PATCH v5 4/4] mips: io: remove duplicated codes Date: Thu, 21 Sep 2023 19:04:24 +0800 Message-ID: <20230921110424.215592-5-bhe@redhat.com> In-Reply-To: <20230921110424.215592-1-bhe@redhat.com> References: <20230921110424.215592-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:02:16 -0700 (PDT) By adding support, the duplicated phys_to_virt can be removed to use the default version in . Meanwhile move isa_bus_to_virt() down below including to fix the compiling error of missing phys_to_virt definition. Signed-off-by: Baoquan He Cc: Thomas Bogendoerfer Cc: Geert Uytterhoeven Cc: Helge Deller Cc: Serge Semin Cc: Florian Fainelli Cc: Huacai Chen Cc: Jiaxun Yang Cc: linux-mips@vger.kernel.org --- arch/mips/include/asm/io.h | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 1ecf255efb40..fe5476c1c689 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -117,24 +117,6 @@ static inline phys_addr_t virt_to_phys(const volatile void *x) return __virt_to_phys(x); } -/* - * phys_to_virt - map physical address to virtual - * @address: address to remap - * - * The returned virtual address is a current CPU mapping for - * the memory address given. It is only valid to use this function on - * addresses that have a kernel mapping - * - * This function does not handle bus mappings for DMA transfers. In - * almost all conceivable cases a device driver should not be using - * this function - */ -#define phys_to_virt phys_to_virt -static inline void * phys_to_virt(unsigned long address) -{ - return __va(address); -} - /* * ISA I/O bus memory addresses are 1:1 with the physical address. */ @@ -143,11 +125,6 @@ static inline unsigned long isa_virt_to_bus(volatile void *address) return virt_to_phys(address); } -static inline void *isa_bus_to_virt(unsigned long address) -{ - return phys_to_virt(address); -} - /* * Change "struct page" to physical address. */ @@ -596,4 +573,9 @@ void __ioread64_copy(void *to, const void __iomem *from, size_t count); #include +static inline void *isa_bus_to_virt(unsigned long address) +{ + return phys_to_virt(address); +} + #endif /* _ASM_IO_H */ -- 2.41.0