diff mbox

[U-Boot,2/3] usb: gadget: fastboot: explicitly set radix of maximum download size

Message ID 1412103942-28331-3-git-send-email-eric.nelson@boundarydevices.com
State Accepted
Delegated to: Ɓukasz Majewski
Headers show

Commit Message

Eric Nelson Sept. 30, 2014, 7:05 p.m. UTC
The processing of the max-download-size variable requires a
radix specifier, or the fastboot host tool will interpret
it as an octal number.

See function get_target_sparse_limit() in file fastboot/fastboot.c
in the AOSP:
        https://android.googlesource.com/platform/system/core/+/master

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
---
 drivers/usb/gadget/f_fastboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Rae Oct. 1, 2014, 8:39 p.m. UTC | #1
On 14-09-30 12:05 PM, Eric Nelson wrote:
> The processing of the max-download-size variable requires a
> radix specifier, or the fastboot host tool will interpret
> it as an octal number.
>
> See function get_target_sparse_limit() in file fastboot/fastboot.c
> in the AOSP:
>          https://android.googlesource.com/platform/system/core/+/master
>
> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
> ---
>   drivers/usb/gadget/f_fastboot.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
> index f970f89..86700f5 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -355,7 +355,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
>   		!strcmp_l1("max-download-size", cmd)) {
>   		char str_num[12];
>
> -		sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
> +		sprintf(str_num, "0x%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
>   		strncat(response, str_num, chars_left);
>   	} else if (!strcmp_l1("serialno", cmd)) {
>   		s = getenv("serial#");
>
(the host version of fastboot that I'm using requires this change!)
Tested-by: Steve Rae <srae@broadcom.com>
diff mbox

Patch

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index f970f89..86700f5 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -355,7 +355,7 @@  static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
 		!strcmp_l1("max-download-size", cmd)) {
 		char str_num[12];
 
-		sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
+		sprintf(str_num, "0x%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
 		strncat(response, str_num, chars_left);
 	} else if (!strcmp_l1("serialno", cmd)) {
 		s = getenv("serial#");