mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-25 16:11:53 +02:00
Fixed 'unused result' warnings
This commit is contained in:
parent
36cd4414a1
commit
aca1d17249
2
Makefile
2
Makefile
@ -9,7 +9,7 @@ endif
|
||||
CC = gcc
|
||||
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
|
||||
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)
|
||||
|
||||
OBJECTS = ${SOURCES:.c=.o}
|
||||
|
20
ingenic.c
20
ingenic.c
@ -290,10 +290,18 @@ int ingenic_loadstage(void *hndl, int id, const char *file) {
|
||||
fseek(fd, 0, SEEK_SET);
|
||||
|
||||
void *data = malloc(size);
|
||||
fread(data, size, 1, fd);
|
||||
size_t read_bytes = fread(data, size, 1, fd);
|
||||
|
||||
fclose(fd);
|
||||
|
||||
if(read_bytes != size) {
|
||||
free(data);
|
||||
|
||||
errno = EIO;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(data + 8, &handle->cfg, sizeof(firmware_config_t));
|
||||
|
||||
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);
|
||||
|
||||
void *data = malloc(size);
|
||||
fread(data, size, 1, fd);
|
||||
size_t bytes = fread(data, size, 1, fd);
|
||||
|
||||
fclose(fd);
|
||||
|
||||
if(bytes != size) {
|
||||
free(data);
|
||||
|
||||
errno = EIO;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ret = ingenic_load_sdram(handle, data, base, size);
|
||||
|
||||
free(data);
|
||||
|
Loading…
Reference in New Issue
Block a user