Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1649625
| From | "Li, Yi" <yi1.li@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API |
| Date | 2017-05-24 15:50 +0200 |
| Message-ID | <tKEPL-2YG-3@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <tJ6wP-5UV-29@gated-at.bofh.it> <tK2Ua-2m2-21@gated-at.bofh.it> <tK9sC-6wZ-1@gated-at.bofh.it> <tKjV0-51B-13@gated-at.bofh.it> <tKjV0-51B-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 5/23/2017 10:25 AM, Alan Tull wrote:
> On Tue, May 23, 2017 at 10:21 AM, Alan Tull <atull@kernel.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);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv2 0/3] Add streaming support to driver_data API yi1.li@linux.intel.com - 2017-05-20 09:00 +0200
[PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API yi1.li@linux.intel.com - 2017-05-20 09:00 +0200
Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API Alan Tull <atull@kernel.org> - 2017-05-22 23:20 +0200
Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API "Li, Yi" <yi1.li@linux.intel.com> - 2017-05-23 06:20 +0200
Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API Alan Tull <atull@kernel.org> - 2017-05-23 17:30 +0200
Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API "Li, Yi" <yi1.li@linux.intel.com> - 2017-05-24 15:30 +0200
Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API "Li, Yi" <yi1.li@linux.intel.com> - 2017-05-24 15:50 +0200
Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API Alan Tull <atull@kernel.org> - 2017-05-23 17:30 +0200
csiph-web