From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Tue, 18 Mar 2014 07:55:04 +0100 Subject: [U-Boot] [PATCH v2 1/3] usb, dfu: extract flush code into seperate function In-Reply-To: <5327E193.9010405@denx.de> References: <1395053778-3765-1-git-send-email-hs@denx.de> <1395053778-3765-2-git-send-email-hs@denx.de> <201403180121.09478.marex@denx.de> <5327E193.9010405@denx.de> Message-ID: <20140318075504.763e9182@amdc2363> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Heiko, > Hello Marek, > > Am 18.03.2014 01:21, schrieb Marek Vasut: > > On Monday, March 17, 2014 at 11:56:16 AM, Heiko Schocher wrote: > >> move the flushing code into an extra function dfu_flush(), > >> so it can be used from other code. > >> > >> Signed-off-by: Heiko Schocher > >> Cc: Lukasz Majewski > >> Cc: Kyungmin Park > >> Cc: Marek Vasut > >> Cc: Pantelis Antoniou > > > > [...] > > > >> @@ -199,23 +221,7 @@ int dfu_write(struct dfu_entity *dfu, void > >> *buf, int size, int blk_seq_num) > >> > >> /* end? */ > >> if (size == 0) { > >> - /* Now try and flush to the medium if needed. */ > >> - if (dfu->flush_medium) > >> - ret = dfu->flush_medium(dfu); > >> - printf("\nDFU complete CRC32: 0x%08x\n", > >> dfu->crc); - > >> - /* clear everything */ > >> - dfu_free_buf(); > >> - dfu->crc = 0; > >> - dfu->offset = 0; > >> - dfu->i_blk_seq_num = 0; > >> - dfu->i_buf_start = dfu_buf; > >> - dfu->i_buf_end = dfu_buf; > >> - dfu->i_buf = dfu->i_buf_start; > >> - > >> - dfu->inited = 0; > >> - > >> - } > >> + ret = dfu_flush(dfu, buf, size, blk_seq_num); > > > > This seems broken, at least because you didn't close the opened > > brace (see 'if (size == 0) {' .... I can fix this up when applying. > > Argh... you are right .... patch 2/3 of this series deletes the > complete if ... I can send a new version, but if you want to fix > it that would be great! In this case, please prepare v3. > > > Do you want this in 2014.04 or in -next ? > > Hmm.. 2014.04 would be nice, but I think this is Lukasz decision, > because I changed the dfu state machine, and maybe he want to see > more tests? When you send the v3, I will test it for regression and then I will prepare pull request to Tom for v2014.04. Those patches will be added to u-boot-dfu repository. > > bye, > Heiko -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group