On Tue, May 23, 2017 at 10:21 AM, Alan Tull <atull@xxxxxxxxxx> wrote:
Or this could be a break instead of a return.Also need: kfree(buf);Yes, this is better, thanks.+This could be "do { ... } while ((params.fw_size >= FIRMWARE_CHUNK_SZ)
+ mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ;
+ while (length > 0) {
&& (length > 0));" since that's what it's really doing.
+ 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;
+ return ret;
+ }Please skip a line before return.
+
+ length -= params.fw_size;
+ params.offset += params.fw_size;
+ if (params.fw_size < SZ_4K)
+ break;
+ }
+
+ kfree(buf);
+ return ret;
+}
+EXPORT_SYMBOL_GPL(fpga_mgr_firmware_stream);