From: Robin Murphy <robin.murphy@arm.com>
To: Stanimir Varbanov <stanimir.varbanov@linaro.org>, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] media: venus: core: Drop local dma_parms
Date: Thu, 10 Sep 2020 15:36:08 +0100 [thread overview]
Message-ID: <8781a8eb-e472-0201-b773-e8b82325675c@arm.com> (raw)
In-Reply-To: <c474d49b-7800-28c6-d73b-20a6d2258e9e@linaro.org>
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@arm.com>
>> ---
>> 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);
>>
>
next prev parent reply other threads:[~2020-09-10 21:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 21:14 [PATCH] media: venus: core: Drop local dma_parms Robin Murphy
2020-09-04 11:36 ` Kieran Bingham
2020-09-04 20:26 ` Stanimir Varbanov
2020-09-10 14:36 ` Robin Murphy [this message]
2020-10-02 8:06 ` Sai Prakash Ranjan
2020-10-02 11:27 ` Stanimir Varbanov
2020-10-02 12:45 ` Sai Prakash Ranjan
2020-10-06 1:02 ` Stephen Boyd
2020-10-06 5:23 ` Sai Prakash Ranjan
2020-10-14 16:09 ` Robin Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8781a8eb-e472-0201-b773-e8b82325675c@arm.com \
--to=robin.murphy@arm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stanimir.varbanov@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox