public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/13] fastboot: Move fastboot response functions to fastboot core
Date: Fri, 4 Sep 2015 13:20:44 -0400	[thread overview]
Message-ID: <20150904172044.GL26226@bill-the-cat> (raw)
In-Reply-To: <1441032373-16992-7-git-send-email-maxime.ripard@free-electrons.com>

On Mon, Aug 31, 2015 at 04:46:06PM +0200, Maxime Ripard wrote:

> The functions and a few define to generate a fastboot message to be sent
> back to the host were so far duplicated among the users.
> 
> Move them all to a common place.
[snip]
> diff --git a/common/aboot.c b/common/aboot.c
> index 18ff30ee6d11..37ad50efc50a 100644
> --- a/common/aboot.c
> +++ b/common/aboot.c
> @@ -277,7 +277,7 @@ void store_sparse_image(sparse_storage_t *storage,
>  
>  	sparse_header = sparse_parse_header(&data);
>  	if (!sparse_header) {
> -		fastboot_fail("sparse header issue\n");
> +		printf("sparse header issue\n");
>  		return;
>  	}
>  
> @@ -288,7 +288,6 @@ void store_sparse_image(sparse_storage_t *storage,
>  	if (sparse_header->blk_sz % storage->block_sz) {
>  		printf("%s: Sparse image block size issue [%u]\n",
>  		       __func__, sparse_header->blk_sz);
> -		fastboot_fail("sparse image block size issue");
>  		return;
>  	}
>  
> @@ -299,7 +298,7 @@ void store_sparse_image(sparse_storage_t *storage,
>  	for (chunk = 0; chunk < sparse_header->total_chunks; chunk++) {
>  		chunk_header = sparse_parse_chunk(sparse_header, &data);
>  		if (!chunk_header) {
> -			fastboot_fail("Unknown chunk type");
> +			printf("Unknown chunk type");
>  			return;
>  		}
>  
> @@ -314,7 +313,6 @@ void store_sparse_image(sparse_storage_t *storage,
>  		if (blk + blkcnt > storage->start + storage->size) {
>  			printf("%s: Request would exceed partition size!\n",
>  			       __func__);
> -			fastboot_fail("Request would exceed partition size!");
>  			return;
>  		}
>  
> @@ -331,7 +329,6 @@ void store_sparse_image(sparse_storage_t *storage,
>  			if (buffer_blks != buffer_blk_cnt) {
>  				printf("%s: Write %d failed %d\n",
>  				       __func__, i, buffer_blks);
> -				fastboot_fail("flash write failure");
>  				return;
>  			}
>  
> @@ -348,9 +345,10 @@ void store_sparse_image(sparse_storage_t *storage,
>  	printf("........ wrote %u bytes to '%s'\n", bytes_written,
>  	       storage->name);
>  
> -	if (total_blocks != sparse_header->total_blks)
> -		fastboot_fail("sparse image write failure");
> +	if (total_blocks != sparse_header->total_blks) {
> +		printf("sparse image write failure");
> +		return;
> +	}
>  
> -	fastboot_okay("");
>  	return;
>  }

Why in the case of this image do we not need to do fastboot_fail/okay
now?  It's not obvious from the rest of the changes to me, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/f4427325/attachment.sig>

  reply	other threads:[~2015-09-04 17:20 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 14:46 [U-Boot] [PATCH 00/13] Implement fastboot over NAND Maxime Ripard
2015-08-31 14:46 ` [U-Boot] [PATCH 01/13] mtd: uboot: Add meaningful error message Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-08-31 14:46 ` [U-Boot] [PATCH 02/13] sparse: Move main header parsing to a function of its own Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-08-31 14:46 ` [U-Boot] [PATCH 03/13] sparse: Refactor chunk parsing function Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-08-31 14:46 ` [U-Boot] [PATCH 04/13] sparse: Simplify multiple logic Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-09-06 11:27     ` Maxime Ripard
2015-09-06 19:28       ` Tom Rini
2015-09-13 17:08         ` Maxime Ripard
2015-08-31 14:46 ` [U-Boot] [PATCH 05/13] sparse: Implement storage abstraction Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-08-31 14:46 ` [U-Boot] [PATCH 06/13] fastboot: Move fastboot response functions to fastboot core Maxime Ripard
2015-09-04 17:20   ` Tom Rini [this message]
2015-09-06 16:11     ` Maxime Ripard
2015-09-06 19:43       ` Tom Rini
2015-08-31 14:46 ` [U-Boot] [PATCH 07/13] fastboot: Implement NAND backend Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-09-06 15:57     ` Maxime Ripard
2015-09-06 19:41       ` Tom Rini
2015-09-10  7:41   ` Boris Brezillon
2015-08-31 14:46 ` [U-Boot] [PATCH 08/13] fastboot: nand: Add pre erase and write hooks Maxime Ripard
2015-09-04 17:20   ` Tom Rini
2015-08-31 14:46 ` [U-Boot] [PATCH 09/13] sparse: Rename the file and header Maxime Ripard
2015-09-04 17:21   ` Tom Rini
2015-09-06 11:28     ` Maxime Ripard
2015-08-31 14:46 ` [U-Boot] [PATCH 10/13] sunxi: Make the fastboot buffer larger Maxime Ripard
2015-08-31 15:01   ` Hans de Goede
2015-08-31 19:17     ` Rob Herring
2015-09-01  7:14       ` Maxime Ripard
2015-09-08 13:00         ` Rob Herring
2015-09-08 15:44           ` Maxime Ripard
2015-09-01  7:05     ` Maxime Ripard
2015-09-01  8:59       ` Hans de Goede
2015-09-03 21:43         ` Maxime Ripard
2015-09-01  8:02     ` Siarhei Siamashka
2015-09-01  7:22   ` Ian Campbell
2015-09-01  7:44     ` Siarhei Siamashka
2015-09-01  8:11       ` Maxime Ripard
2015-09-04 17:02       ` Tom Rini
2015-09-06 11:23         ` Maxime Ripard
2015-09-01  7:57     ` Maxime Ripard
2015-09-04 16:59       ` Tom Rini
2015-09-06 11:22         ` Maxime Ripard
2015-09-07  9:07           ` Ian Campbell
2015-08-31 14:46 ` [U-Boot] [PATCH 11/13] sunxi: Add support for android boot image Maxime Ripard
2015-09-01  7:08   ` Ian Campbell
2015-09-01  7:15     ` Maxime Ripard
2015-09-01  9:00     ` Paul Kocialkowski
2015-09-01 10:46       ` Ian Campbell
2015-09-01 11:29         ` Maxime Ripard
2015-09-01 13:54           ` Ian Campbell
2015-09-01 13:59             ` Paul Kocialkowski
2015-09-01 11:28       ` Maxime Ripard
2015-09-08 13:12     ` Rob Herring
2015-08-31 14:46 ` [U-Boot] [PATCH 12/13] sunxi: A13-Olinuxino: Enable the USB OTG controller Maxime Ripard
2015-09-01  9:01   ` Hans de Goede
2015-09-03 21:41     ` Maxime Ripard
2015-09-10 18:47       ` Hans de Goede
2015-09-13 17:13         ` Maxime Ripard
2015-09-13 17:38           ` Hans de Goede
2015-09-14 21:19             ` Maxime Ripard
2015-08-31 14:46 ` [U-Boot] [PATCH 13/13] sunxi: cubietruck: " Maxime Ripard

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=20150904172044.GL26226@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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