Re: [PATCH] media: venus: core: Drop local dma_parms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-09-04 21:26, Stanimir Varbanov wrote:
Hi Robin,

Thanks for the patch!

On 9/4/20 12:14 AM, Robin Murphy wrote:
Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms
for platform devices"), struct platform_device already provides a
dma_parms structure, so we can save allocating another one.

Also the DMA segment size is simply a size, not a bitmask.

Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx>
---
  drivers/media/platform/qcom/venus/core.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 203c6538044f..2fa9275d75ff 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -226,13 +226,7 @@ static int venus_probe(struct platform_device *pdev)
  	if (ret)
  		return ret;
- if (!dev->dma_parms) {
-		dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
-					      GFP_KERNEL);
-		if (!dev->dma_parms)
-			return -ENOMEM;
-	}
-	dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
+	dma_set_max_seg_size(dev, UINT_MAX);

To be correct we should check for EIO error?

Well, half the point of 9495b7e92f71 was to make sure that dma_set_max_seg_size() cannot fail for platform drivers. Thus if we're taking advantage of that change to make the assumption that we never need to allocate dma_parms here, then an error check would be redundant by definition ;)

Robin.


INIT_LIST_HEAD(&core->instances);
  	mutex_init(&core->lock);





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux