[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-fpga
Subject:    Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API
From:       "Li, Yi" <yi1.li () linux ! intel ! com>
Date:       2017-05-24 13:45:42
Message-ID: 32f80c2a-e7e3-d822-9582-c8942e2a9d83 () linux ! intel ! com
[Download RAW message or body]



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);

--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic