From patchwork Tue May 16 19:39:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp663682vqo; Tue, 16 May 2023 12:49:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vx0arbEEf9sD1CSmNqtGQ5Lt/bLMN+5dwXnNTYzOmgEXNctsWHTudjo5Lg6aWXWFJ80a/ X-Received: by 2002:a05:6a20:cd:b0:103:d2cd:4dec with SMTP id 13-20020a056a2000cd00b00103d2cd4decmr18060996pzh.55.1684266572885; Tue, 16 May 2023 12:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684266572; cv=none; d=google.com; s=arc-20160816; b=HzPjCFZvZVgpyCrK+b3fpGdm4LuuvPk5084tHe1oQ4yi+tMrvYGKTHThOAYPH8bUCY 65YUYaup+Bs9N6YTqN6P8ytfs7oK0XWKdOvVWd7oSQZXHTtdFShJNqt+OZBT9il/ef99 rtwbNdBe8O6Ld3LUN1sKB7IUvZUYJWY3QvzRLvdmobssa3teRoPMIWzi03O/AT3mkm3p vU+OWX5UZYhpD+1jQnsZAJSJT4d5Hjo/wUaTN+1XpwpB/G4jZCIh9OUyftH5Pi05Bc9z nqtZIO+sG4VyuABnbYJ9sj/b4qN6hKNYsPjWmas+Jj/gB8rv6FxIHU235HHQXGRWvnyM nuxg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=PG58NQMQBsZoD1f1hPZB7YEsg0Uj68I50AXN14phZwM=; b=dsHuzPlIHk/IcZn6DXxGlT3fNCppNROmI6RXEDIk4W6YwwSzH8WYW+IeeJJsydwrUK iW/x0maHX5Dtov3nhzqwlyOvstsae8S/r8Xne6vfsYy3+9Xo/ilR7OtGrPwbuAgSoUZ/ j6mqiR2yGLp0trPWTCDfysoRyhwsJMhNA/ChJEupIGalZVRAFa71MIBvI+n3nf96YJrl JU0+6s/+7R3+EZUES0t0ylTF8P/ze7SjYngJBMwlzAgpNLry0bw9t+t8KklNi4RICP5J VTK82xZak0DtmkAFRG+Ns8TA3xpJprLQ19PEh1CICKJO//WswX9k2nE1kGHYFMzkToY4 1Dzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PPja12+j; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l64-20020a638843000000b00534253c0576si4810773pgd.535.2023.05.16.12.49.20; Tue, 16 May 2023 12:49:32 -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=@kernel.org header.s=k20201202 header.b=PPja12+j; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbjEPTln (ORCPT + 99 others); Tue, 16 May 2023 15:41:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjEPTle (ORCPT ); Tue, 16 May 2023 15:41:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FE454494; Tue, 16 May 2023 12:41:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BF0F5635A1; Tue, 16 May 2023 19:40:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD8D0C433EF; Tue, 16 May 2023 19:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684266009; bh=8n2CvzDo289ObcDnbgcLUxlNv6SunFRuUSz2MeWdEMM=; h=From:To:Cc:Subject:Date:From; b=PPja12+jUDGrCbIzpFocVLXHKNfRllVRa/7kobiZhwTwubGr2MFZw3y/5/bvrEThA 6WGO5HuaTDWe0pTkZTYjFic6nTQPW1y6R0j7/qko/z2uhI8mzQuFlE+F8v0jV5ZA3E kmoXEWxYtS7L2k2x0Q0sOCBdMiYZgIwHHyxmgtABBeENRgim1TWHxLzFiK9At1lMYJ bAMffkM6q+jFgAxDo7kq6qiANwmEeUEKDR/6i9YugWrRPujT0/sTlnRmOpckxiq6Vr gtFoFG6xUDZrBqapU28gMi80jXfo4h54UuTP/g20HqiPcM3vdS0rL2jF0zX2p0IFAA OGpcDJsH+d8vQ== From: Arnd Bergmann To: Thomas Bogendoerfer Cc: Arnd Bergmann , Greg Kroah-Hartman , Geert Uytterhoeven , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mips: provide unxlate_dev_mem_ptr() in asm/io.h Date: Tue, 16 May 2023 21:39:42 +0200 Message-Id: <20230516194000.548487-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766081506186027276?= X-GMAIL-MSGID: =?utf-8?q?1766081506186027276?= From: Arnd Bergmann The unxlate_dev_mem_ptr() function has no prototype on the mips architecture, which does not include asm-generic/io.h, so gcc warns about the __weak definition: drivers/char/mem.c:94:29: error: no previous prototype for 'unxlate_dev_mem_ptr' [-Werror=missing-prototypes] Since everyone else already gets the generic definition or has a custom one, there is not really much point in having a __weak version as well. Remove this one, and instead add a trivial macro to the mips header. Once we convert mips to use the asm-generic header, this can go away again. Signed-off-by: Arnd Bergmann --- arch/mips/include/asm/io.h | 1 + drivers/char/mem.c | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index cc28d207a061..affd21e9c20b 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -554,6 +554,7 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size); * access */ #define xlate_dev_mem_ptr(p) __va(p) +#define unxlate_dev_mem_ptr(p, v) do { } while (0) void __ioread64_copy(void *to, const void __iomem *from, size_t count); diff --git a/drivers/char/mem.c b/drivers/char/mem.c index f494d31f2b98..94eff6a2a7b6 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -90,13 +90,6 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) } #endif -#ifndef unxlate_dev_mem_ptr -#define unxlate_dev_mem_ptr unxlate_dev_mem_ptr -void __weak unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) -{ -} -#endif - static inline bool should_stop_iteration(void) { if (need_resched())