]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
staging: vchiq_arm: Don't cast scatter-gather elements
authorStefan Wahren <wahrenst@gmx.net>
Fri, 21 Jun 2024 13:19:57 +0000 (15:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jun 2024 13:26:56 +0000 (15:26 +0200)
The kernel uses different types for DMA length & address,
so better use them.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240621131958.98208-10-wahrenst@gmx.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c

index a8cf9233a6241af87d1f8ca7f5cd4bda8540dc49..472fddb1a2fe5b74ff9058c10f08d4dce7d98e83 100644 (file)
@@ -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-