1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-29 11:46:15 +02:00

Fixed 'unused result' warnings

This commit is contained in:
Sergey Gridassov 2010-12-10 17:02:51 +03:00
parent 36cd4414a1
commit aca1d17249
2 changed files with 19 additions and 3 deletions

View File

@ -9,7 +9,7 @@ endif
CC = gcc CC = gcc
TARGET = jzboot TARGET = jzboot
SOURCES = debug.c devmgr.c ingenic.c main.c shell_lex.c usbdev.c shell.c shell_builtins.c config.c spl_cmdset.c usbboot_cmdset.c SOURCES = debug.c devmgr.c ingenic.c main.c shell_lex.c usbdev.c shell.c shell_builtins.c config.c spl_cmdset.c usbboot_cmdset.c
CFLAGS = --std=gnu99 -Wall -Werror -O2 $(shell pkg-config libusb-1.0 --cflags) CFLAGS = --std=gnu99 -Wall -Werror -O2 $(shell pkg-config libusb-1.0 --cflags) -Wunused-result
LIBS += $(shell pkg-config libusb-1.0 --libs) LIBS += $(shell pkg-config libusb-1.0 --libs)
OBJECTS = ${SOURCES:.c=.o} OBJECTS = ${SOURCES:.c=.o}

View File

@ -290,10 +290,18 @@ int ingenic_loadstage(void *hndl, int id, const char *file) {
fseek(fd, 0, SEEK_SET); fseek(fd, 0, SEEK_SET);
void *data = malloc(size); void *data = malloc(size);
fread(data, size, 1, fd); size_t read_bytes = fread(data, size, 1, fd);
fclose(fd); fclose(fd);
if(read_bytes != size) {
free(data);
errno = EIO;
return -1;
}
memcpy(data + 8, &handle->cfg, sizeof(firmware_config_t)); memcpy(data + 8, &handle->cfg, sizeof(firmware_config_t));
if(ingenic_wordop(handle->usb, VR_SET_DATA_ADDRESS, base) == -1) { if(ingenic_wordop(handle->usb, VR_SET_DATA_ADDRESS, base) == -1) {
@ -452,10 +460,18 @@ int ingenic_load_sdram_file(void *hndl, uint32_t base, const char *file) {
fseek(fd, 0, SEEK_SET); fseek(fd, 0, SEEK_SET);
void *data = malloc(size); void *data = malloc(size);
fread(data, size, 1, fd); size_t bytes = fread(data, size, 1, fd);
fclose(fd); fclose(fd);
if(bytes != size) {
free(data);
errno = EIO;
return -1;
}
int ret = ingenic_load_sdram(handle, data, base, size); int ret = ingenic_load_sdram(handle, data, base, size);
free(data); free(data);