From patchwork Fri Jun 21 13:19:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13707601 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 743AAC2BBCA for ; Fri, 21 Jun 2024 13:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=clkBG9k6stThD9RBx61+zAMxdNQkLd7Uivc4tSeL2Ak=; b=gT2lCcm30KyPcADKzRwkRdRlYi e1EFTcCQeVMtfAefQAIbF886HRnjUB/Y3k87WmPN+89eKpfa/6Tg7CwMe5rFDPmjk6sHP+bgKcr1j Xh1QnaHFgfZcJO4uNE9bZA2gvpd2mE7c7p74eAAHTmrQviPqbP5hCGfDlCp0UEEPUlnccYcJmDGIT VKe0riE5x3vvDTFMz2vVdLzaaanIj0wghPN69GOJhcLzgUJnfTq2R0tIisvY7XKP7AW9W06osNvii 4DvmwLqVkKL6zG6G9OM68i2sdlwkKhrYEN/x7PCBMQ+Wj98naI4K8okNk0oNY/fdgR9P06FUsEoGj 9qMWvMhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBt-00000009J9i-3Uee; Fri, 21 Jun 2024 13:20:33 +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 1sKeBh-00000009J1V-3bOK for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976018; x=1719580818; i=wahrenst@gmx.net; bh=clkBG9k6stThD9RBx61+zAMxdNQkLd7Uivc4tSeL2Ak=; 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=t72FNY3CAXh7zBzUToAWDUW99V2DLjKMycCL9P9m9LLu/jiXgwq0Z7Lq+G28pQjO gkJusI9PG1aNkuW1GTWzp3dYSVV3A89U8XdN8n++1ttOLM5AjlSHA+dDp/FCXm3t6 X2Sp2PwpXqseWtqhljREDyPhSG3veHqQKkn6eA8agI0Rfeui57q3EMpjH3Kec35Vr NG9grTkXDs2NtDPjL4B+iOo3dBl5VpoeS3Ns7gVLTa1jb3t7q5EpQIS/dC6C8r5PC jQ3cnLKfbQFbKQGiG9QXbpV2/ChdiOOE72NrECU26nnMh9LXBMQstyWjnameVREdL LlOJ3zEhhvJkFvi31Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N8XTv-1sOn6h0Npx-015xh7; Fri, 21 Jun 2024 15:20:18 +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 V3 09/10] staging: vchiq_arm: Don't cast scatter-gather elements Date: Fri, 21 Jun 2024 15:19:57 +0200 Message-Id: <20240621131958.98208-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:oUg2nHKfmJ0tOdxWjx6vA3BoVLPBJfzUUsVPltIEaY1yaEiW+KA tv3ZBauU9mPeWZNf5E8rDLOndjOA+d6hL062LBtFfMDjH9KuiLBsd+1ChI2sBxF6YBsUY20 Ve1tkJkTOqgzjk6Wse7rv6SQLiQ33LAi2WV8iR6KIgo/L9m/NICriQllIHOJqQVuVZh56xi MRNyijoohR46MijTpf+3g== UI-OutboundReport: notjunk:1;M01:P0:KsbaDeR4UP8=;5QDnxM9sLz+enNdrUt9/JWs3zRh go7VJR/gy0Gz/wmzNsInV2LSedasrPBEfbqYwPhMMJamwTZq3RApNm1DzuqUdsWxGkxMjVquH rl5+0JDpoyxaovkLZoLrOCE95bUh0Mm/IcPTCx4QHP62NKSoWdb+b1xqAR9ZXyjCBJY80CPCl ywf1Ez8MfWZXR9Yl92RQwuqdd7GNMQJQqxSjX0k/ogj9WEaFpeSgaSKunbWx1R1dH7TDxA7aG E6l6vcp1aqH1SFicAOpcjc3Cfsbr0IMBo7JZ3pXTAM99Wu4JmqHC4ydsca+ux2qG82GGZm+c/ ULP8myfK2G7M24oeIGp01TOXwvG0n0rTSGO51Hv2n6NUvMhdibocIc1FbDbsCNVjB2HTgzkmW 8Mua4KZRg1qjaGcgvVlX0v949TmU+7SkPWI9z7COgWvtfI7JUa+t65ajoJ83BbZjhcuk2wvuI 24/uZTn8nUW8mdVETkApbYhU/38nYZHPukZ8JdmA8gfZGP5KHZ8Wk0nmGoIW78bfTvy0N3wws JE3tVEsjLoeXaSRoHY9KyNSwYFrkTgY7IfuSupxMxYwHGFHl0dq3Hm22k6LgRnD9ET2PUo/z0 0O3zprTSZF7/R8WZ1gA3wP2iARr4h0Nct/YXKzF/CHqinlmR5Gq7HtQLYSLAdjy29P+01fyW5 7Oyl/GQF5jZ0395aT2c317O/BY+l5T3Hwl/AN9+gKgNCjGm28wcVg4qKOb/FaqKJDgpqldXqX eZVCnY3MO7eAlS3E4wercRi8/SmtLY81M7L+iZBlJPhpcMm8s0YVD4bAW0VUzbPiDqqgOTkI2 fzckXNDTyowVYRWk9nY+6xuzaxXtWNMiGf7ywsV1lHzTY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062022_230099_A7C8C68E X-CRM114-Status: GOOD ( 10.00 ) 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 e3d49d4bdb1d..9e6102c43e00 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-