From patchwork Tue Nov 1 08:01:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2809012wru; Tue, 1 Nov 2022 01:06:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kfdG+U7pew2YKsq93YGEmG8TsrB6C/QhsTJf1D7+gefELVK2T0A9qNdqQ6Vb8WFzuD4rm X-Received: by 2002:a05:6402:358e:b0:461:ea80:fb61 with SMTP id y14-20020a056402358e00b00461ea80fb61mr17576029edc.356.1667289963445; Tue, 01 Nov 2022 01:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667289963; cv=none; d=google.com; s=arc-20160816; b=HMr86b527S4yPoamQjGH0cIXDNzpU/TFUhrA3CWdrw6QYkuLlAbGGMYvpxpkLtDUnx TQF6aNd4ltMjJajGJuaKvbvVtBV/cFa625GRFBP4kw79CYokYLxwa0oQ2oZ4Ert8MqcV gK0DgbKlNai0QrTZ3NNARyQPk/uTCqMqhAb6z9TRGdSFB2f70UDhVB2JDlvs6j+YztRO GQnclePFtqIjwU8xlkATLgpXyHEgRbYzfFG42FzYGnBlxicY6FWhNxnahpFaeCPbHOy7 pyMuXUK7QidjnV2ln0y0SLYwjG/l/ThNS5Lyd+WuiTQYSiC+386K+U2tD8UwML710VwQ Tnyg== 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; bh=3Xt8bkcUT5JWJnWkWG14meSrO62UbAbYWp8TqvmJtfs=; b=LkVLgS5f/9zaCn6BDM46WVKhY6stgtkuQN7krDnR2p0PZgFau/6R7rwewFpxId0whl X55Y9lXKnlGBiZe/zQlLf5xhCWh0xRwQTcObe1S18lxGtRbjN61YZai1HAOViwcGugdd yryN0fiIhzWU2VrWIaZJKHWOc26lkrjIaes8FCPQR5s3t0nBkv09u4j7wFqxoSsMAUm/ uUWTxCSuQIxpRpJPfSXWXJwHcOmH1v6Yo8yU/gHDxGv6s61mojOePw8V/Edv81TZB9VB s9iyyyiYDn7C5c7BzOYpwvEreyorVpiBRcFB4WtX/Z0FfSvvAUnYdqPAbaN1QGeiYy1Y C+qQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a50d4c8000000b0046154f0f866si10045321edj.159.2022.11.01.01.05.38; Tue, 01 Nov 2022 01:06: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbiKAIBt (ORCPT + 99 others); Tue, 1 Nov 2022 04:01:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbiKAIBo (ORCPT ); Tue, 1 Nov 2022 04:01:44 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A7136590 for ; Tue, 1 Nov 2022 01:01:43 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:cd8a:284a:a448:1949]) by baptiste.telenet-ops.be with bizsmtp id ew1g2800U2kye1T01w1gU2; Tue, 01 Nov 2022 09:01:41 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1opmDM-002G44-GS; Tue, 01 Nov 2022 09:01:40 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1opmCu-0039Q2-Rv; Tue, 01 Nov 2022 09:01:12 +0100 From: Geert Uytterhoeven To: Thomas Bogendoerfer , Greg Kroah-Hartman Cc: linux-mips@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] staging: octeon: cvmx_ptr_to_phys() should return physaddr_t Date: Tue, 1 Nov 2022 09:01:11 +0100 Message-Id: <20221101080111.750748-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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?1748280240309984877?= X-GMAIL-MSGID: =?utf-8?q?1748280240309984877?= On 32-bit without physical address extensions (e.g. sh-allmodconfig): drivers/staging/octeon/ethernet-mem.c: In function ‘cvm_oct_free_hw_memory’: ./arch/sh/include/asm/io.h:239:32: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 239 | #define phys_to_virt(address) ((void *)(address)) | ^ drivers/staging/octeon/ethernet-mem.c:123:18: note: in expansion of macro ‘phys_to_virt’ 123 | fpa = (char *)phys_to_virt(cvmx_ptr_to_phys(fpa)); | ^~~~~~~~~~~~ Fix this by making cvmx_ptr_to_phys() return physaddr_t instead of uint64_t. Signed-off-by: Geert Uytterhoeven --- Compile-tested only (sh, mips allmodconfig, mips allmodconfig+CONFIG_CAVIUM_OCTEON_=y) --- arch/mips/include/asm/octeon/cvmx.h | 4 ++-- drivers/staging/octeon/octeon-stubs.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h index 25854abc95f8a2cd..72e775bf31e6008b 100644 --- a/arch/mips/include/asm/octeon/cvmx.h +++ b/arch/mips/include/asm/octeon/cvmx.h @@ -154,13 +154,13 @@ static inline uint64_t cvmx_build_bits(uint64_t high_bit, /** * Convert a memory pointer (void*) into a hardware compatible - * memory address (uint64_t). Octeon hardware widgets don't + * memory address (phys_addr_t). Octeon hardware widgets don't * understand logical addresses. * * @ptr: C style memory pointer * Returns Hardware physical address */ -static inline uint64_t cvmx_ptr_to_phys(void *ptr) +static inline phys_addr_t cvmx_ptr_to_phys(void *ptr) { if (sizeof(void *) == 8) { /* diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h index 3f8e5713b8a850f0..7a02e59e283fbae8 100644 --- a/drivers/staging/octeon/octeon-stubs.h +++ b/drivers/staging/octeon/octeon-stubs.h @@ -1212,7 +1212,7 @@ static inline void *cvmx_phys_to_ptr(uint64_t physical_address) return (void *)(uintptr_t)(physical_address); } -static inline uint64_t cvmx_ptr_to_phys(void *ptr) +static inline phys_addr_t cvmx_ptr_to_phys(void *ptr) { return (unsigned long)ptr; }