diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-01-08 12:57:59 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-01-08 12:57:59 +0100 |
commit | be10ca901ee719d326b95620c3a6ef1346e8c5e7 (patch) | |
tree | 331870ed7fc9b14ad0ddeccef33c1ae8b939f0c6 | |
parent | 87a3f5056e2b0311fc978fe9059b124488690788 (diff) |
fix compiler warnings
-rw-r--r-- | usb-dfu-experiment/sam3u_chipid_usbserial.c | 15 |
1 files changed, 11 insertions, 4 deletions
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; } |