From be10ca901ee719d326b95620c3a6ef1346e8c5e7 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 8 Jan 2012 12:57:59 +0100 Subject: fix compiler warnings --- usb-dfu-experiment/sam3u_chipid_usbserial.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'usb-dfu-experiment') diff --git a/usb-dfu-experiment/sam3u_chipid_usbserial.c b/usb-dfu-experiment/sam3u_chipid_usbserial.c index c8d0e70..c62561e 100644 --- a/usb-dfu-experiment/sam3u_chipid_usbserial.c +++ b/usb-dfu-experiment/sam3u_chipid_usbserial.c @@ -16,12 +16,12 @@ static uint8_t usb_serial_string[USBStringDescriptor_LENGTH(32)]; /* convert from 7-bit ASCII to USB string */ -static int to_usb_string(char *out, int out_len, const char *in) +static int to_usb_string(unsigned char *out, int out_len, const char *in) { int in_len = strlen(in); int num_out = USBStringDescriptor_LENGTH(in_len); int i; - char *cur = out; + unsigned char *cur = out; if (num_out > out_len || num_out >= 255 || num_out < 0) return -EINVAL; @@ -43,7 +43,7 @@ static int chip_uid_to_usbstring(void) int rc; FLASHD_Initialize(0); - rc = FLASHD_ReadUniqueID(&uniqueID); + rc = FLASHD_ReadUniqueID(uniqueID); if (rc != 0) return -EIO; @@ -59,6 +59,13 @@ static int chip_uid_to_usbstring(void) int chipid_to_usbserial(void) { - chip_uid_to_usbstring(); + int rc; + + rc = chip_uid_to_usbstring(); + if (rc < 0) + return rc; + set_usb_serial_str(usb_serial_string); + + return 0; } -- cgit v1.2.3