From: "Li, Yi" <yi1.li@linux.intel.com>
To: Alan Tull <atull@kernel.org>
Cc: mcgrof@kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
wagi@monom.org, David Woodhouse <dwmw2@infradead.org>,
rafal@milecki.pl, arend.vanspriel@broadcom.com,
rjw@rjwysocki.net, Moritz Fischer <moritz.fischer@ettus.com>,
pmladek@suse.com, johannes.berg@intel.com,
emmanuel.grumbach@intel.com,
Luca Coelho <luciano.coelho@intel.com>,
kvalo@codeaurora.org, luto@kernel.org,
Takahiro Akashi <takahiro.akashi@linaro.org>,
dhowells@redhat.com, pjones@redhat.com,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-fpga@vger.kernel.org
Subject: Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API
Date: Wed, 24 May 2017 08:45:42 -0500 [thread overview]
Message-ID: <32f80c2a-e7e3-d822-9582-c8942e2a9d83@linux.intel.com> (raw)
In-Reply-To: <CANk1AXQ_nrXUqOdqUFkRYRz_arEg_7YAhZrp2z3-5SbmWOSmWQ@mail.gmail.com>
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);
prev parent reply other threads:[~2017-05-24 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 6:49 [PATCHv2 0/3] Add streaming support to driver_data API yi1.li
2017-05-20 6:49 ` [PATCHv2 1/3] firmware: Add streaming support for driver_data_request_sync API yi1.li
2017-05-20 6:49 ` [PATCHv2 2/3] test: add streaming test to driver_data tester yi1.li
2017-05-20 6:49 ` [PATCHv2 3/3] fpga_mgr: Add streaming support through the new driver_data API yi1.li
2017-05-22 21:09 ` Alan Tull
2017-05-23 4:11 ` Li, Yi
2017-05-23 15:21 ` Alan Tull
2017-05-23 15:25 ` Alan Tull
2017-05-24 13:25 ` Li, Yi
2017-05-24 13:45 ` Li, Yi [this message]
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=32f80c2a-e7e3-d822-9582-c8942e2a9d83@linux.intel.com \
--to=yi1.li@linux.intel.com \
--cc=arend.vanspriel@broadcom.com \
--cc=atull@kernel.org \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=emmanuel.grumbach@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=johannes.berg@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=luto@kernel.org \
--cc=mcgrof@kernel.org \
--cc=moritz.fischer@ettus.com \
--cc=pjones@redhat.com \
--cc=pmladek@suse.com \
--cc=rafal@milecki.pl \
--cc=rjw@rjwysocki.net \
--cc=takahiro.akashi@linaro.org \
--cc=wagi@monom.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