[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5248dcc2-b283-f473-07b7-273185d1f731@linux.intel.com>
Date: Wed, 24 May 2017 08:25:21 -0500
From: "Li, Yi" <yi1.li@...ux.intel.com>
To: Alan Tull <atull@...nel.org>
Cc: mcgrof@...nel.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
wagi@...om.org, David Woodhouse <dwmw2@...radead.org>,
rafal@...ecki.pl, arend.vanspriel@...adcom.com, rjw@...ysocki.net,
Moritz Fischer <moritz.fischer@...us.com>, pmladek@...e.com,
johannes.berg@...el.com, emmanuel.grumbach@...el.com,
Luca Coelho <luciano.coelho@...el.com>, kvalo@...eaurora.org,
luto@...nel.org, Takahiro Akashi <takahiro.akashi@...aro.org>,
dhowells@...hat.com, pjones@...hat.com,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-fpga@...r.kernel.org
Subject: Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new
driver_data API
On 5/23/2017 10:25 AM, Alan Tull wrote:
> On Tue, May 23, 2017 at 10:21 AM, Alan Tull <atull@...nel.org> wrote:
>
>>>>> +
>>>>> + mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ;
>>>>> + while (length > 0) {
>>>> This could be "do { ... } while ((params.fw_size >= FIRMWARE_CHUNK_SZ)
>>>> && (length > 0));" since that's what it's really doing.
>>> Yes, this is better, thanks.
>>>
>>>>> + ret = driver_data_request_sync(image_name, &req_params,
>>>>> dev);
>>>>> + if (ret) {
>>>>> + dev_err(dev, "Error reading firmware %d\n", ret);
>>>>> + mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ_ERR;
>> Also need: kfree(buf);
>>
>>>>> + return ret;
> Or this could be a break instead of a return.
Thanks Alan, will fix it.
>>>>> + }
>>>>> +
>>>>> + length -= params.fw_size;
>>>>> + params.offset += params.fw_size;
>>>>> + if (params.fw_size < SZ_4K)
>>>>> + break;
>>>>> + }
>>>>> +
>>>>> + kfree(buf);
>>>> Please skip a line before return.
>>>>
>>>>> + return ret;
>>>>> +}
>>>>> +EXPORT_SYMBOL_GPL(fpga_mgr_firmware_stream);
Powered by blists - more mailing lists