From patchwork Mon Jun 10 21:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B76A7C41513 for ; Mon, 10 Jun 2024 21:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AiTzKqJP98sikEiNUYeHjQs2GdHj1BlxKM8XRvbPQps=; b=MFSN9CB0352BJt WKFPfjGU/YYM0Q9jKUxicd3oJqAW6yN/AiN79KGZ3qRMRsvrAXW0lN7NWjMQJzjNW6bJ3rCQe3BjB Kg5HEMFeEUUoqw6V82rwrjmVGLMz75fsDpqbcWD4cLyRosbqicvmVtDQKyY5uWJ7C8XxskS0NaOLJ r1/04QVu144npE9/PihTf7jxAQX9sWTveMY3QwimGkhvZE9vF5IQOaxuKiy2cGpHZJfI+Jgnurvxq d+VXdl5S/BLVbhdy0lij9bIBfVfGuW7Fki6kA1dl8c1L+kDiuAGnTSCll6ykBNF9/SN936l9J5MuL T5BhAVo/cb5CQKRbw+/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAV-00000006U1H-46lB; Mon, 10 Jun 2024 21:03:08 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006Tmd-3IUw for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053364; x=1718658164; i=wahrenst@gmx.net; bh=dz+Ztr+H90QiZfF3gUr2cM0tb7zn20bPsMucWMQkuCY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=QrwY2C0BSTKCjEiavKGw7a9ZqqUCjGLoy3Bjrh+hQW9Vm5qc+AB7hIHPG/phnyWV Eg8FIFfht2tSMqZLWCFTUPREOi41HDSY4l7C8FmuJOCNNLj5moGXzMEfY8bfZii/E kglUdoZ0NZ4bOR/Utd02FirzhqoSP5ElTa5JnJoriyYFj/krMZpGIx9rygFxEm0st YFNOl1mQd1Qmpp0G8wtsgAUDrxrO2jkA3xFx9X5EAGzwjyVbGdx5pzE1z8gzzQ1Ds vmwdnNBAmDEXIPfwv8+QEKg6eEr748qiHgc97bAPRXi7DNw+CEVwAapxGBctOPi1f tGDphvvYPjy3E0wGUw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtOKi-1sYzTG1DJ8-015Lbc; Mon, 10 Jun 2024 23:02:44 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 09/10] staging: vchiq_arm: Don't cast scatter-gather elements Date: Mon, 10 Jun 2024 23:02:19 +0200 Message-Id: <20240610210220.95524-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:AU1M+rIRn+YXGsOGeaf1U8LDOmKf2Ayj9OTRLgWmnyZM5sErLNo YvwObcWEVuYC+HGUL5EKpr7lwAFMy5jLTNKTxL/xgk1xHmW4WdUU/FW9n6T1aisS6kggUlQ SzAtuj1Jmjq3pLCW1TudkpS874sM1MOxWtpP2CCROyyOI7Yngezxj3Y5GTUk/ySdTyi3FuH +X2qVI6iEh2reaZ4e7YoQ== UI-OutboundReport: notjunk:1;M01:P0:9wxSLz1OYSk=;rsn4us+HhQLrct/dLRbRVGzM48k VYz0gRJRZAeMZnm9uB5IcJyeldXlciiMJc2r2hgPN6R30UjEo+S22on27z0NLNv2rDS46DkHd 1FSbwII8cgTRfaoNar4IZSOIutWGpCfP1YCtO0L7UZifknn2sZCMVrCklQGqs7lCJQ9EySz24 LXSiGNDS06hBDasv//qcJ91dJ15LQPpVNF7qiLANtDBxcgsFh93FI/D+a1QcxnrX2BdSEmwnq CYOY96Oy6ABmdV7U2u+4mvoEQIKBUCghOyiqaGJ5PtrzlYNwPNDV3A4qu8VahkWK0ZZNv6nqF 9k5iJbluiVniYDXok05lwexoO+ORyrhAVBc7JUr7XZHdtIrlv0GhBj6FnDCqCnhWugB1I3lh0 Rb7bbvrJJEEfAidkncZ0jxzjrhGrDRrTYnvPi0tPGaDW8wwUyfTXqVTNa0wa2/UbA0LGspCEt E3TtYjIx9gQ11SACl50lpXyM0V+PUm9qalbFKTwXWNoiEk6QvpV/0L0PvIhc1g0Ml9KtKtm9T lZsqX750g7KKNTOtg1nic1dQhlXbpu4UTje+4E3hvvMAuTrl/kv7mQzm2kFzAI8eaeYPIUm1V qrCXQHq49nykuqyuP5dxjYn+wWfQKsllXwkAANav3sk7nVCpjkWPxYfME8kHy3W/tdJ2VrZBZ eYz9p6cVhP9plUczUAkMJUlozpISYvwlAOE3hUsob6I4KPvnTWwAme2G4BbK/Urug6W95/Mpo KemMslPTxUgs3T7NgfLBypZzW/Yp2PP/j+GID3ekSGkqJYwrFJiULQS7UXrJ67hWsmAOT0rwk BT/eIaQUjyUzoP3vQMNTjM7JlfAPCjEz3RaJouMSgJh+A= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_289601_40975D0C X-CRM114-Status: GOOD ( 10.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The kernel uses different types for DMA length & address, so better use them. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.34.1 diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 706bfc7a0b90..02392073c4aa 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -162,7 +162,7 @@ cleanup_pagelistinfo(struct vchiq_instance *instance, struct vchiq_pagelist_info } static inline bool -is_adjacent_block(u32 *addrs, u32 addr, unsigned int k) +is_adjacent_block(u32 *addrs, dma_addr_t addr, unsigned int k) { u32 tmp; @@ -377,8 +377,8 @@ create_pagelist(struct vchiq_instance *instance, char *buf, char __user *ubuf, /* Combine adjacent blocks for performance */ k = 0; for_each_sg(scatterlist, sg, dma_buffers, i) { - u32 len = sg_dma_len(sg); - u32 addr = sg_dma_address(sg); + unsigned int len = sg_dma_len(sg); + dma_addr_t addr = sg_dma_address(sg); /* Note: addrs is the address + page_count - 1 * The firmware expects blocks after the first to be page-