mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 07:04:28 +00:00
tools: env: fw_env: Fix unused-result warning
Fix unused-result warning about fread. tools/env/fw_env.c: In function ‘find_nvmem_device’: tools/env/fw_env.c:1751:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 1751 | fread(buf, sizeof(buf), 1, fp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
This commit is contained in:
parent
2b2e9127cc
commit
c059a22b77
1 changed files with 9 additions and 1 deletions
10
tools/env/fw_env.c
vendored
10
tools/env/fw_env.c
vendored
|
@ -1733,6 +1733,7 @@ static int find_nvmem_device(void)
|
||||||
|
|
||||||
while (!nvmem && (dent = readdir(dir))) {
|
while (!nvmem && (dent = readdir(dir))) {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) {
|
if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1748,7 +1749,14 @@ static int find_nvmem_device(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(buf, sizeof(buf), 1, fp);
|
size = fread(buf, sizeof(buf), 1, fp);
|
||||||
|
if (size != 1) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"read failed about %s\n", comp);
|
||||||
|
fclose(fp);
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!strcmp(buf, "u-boot,env")) {
|
if (!strcmp(buf, "u-boot,env")) {
|
||||||
bytes = asprintf(&nvmem, "%s/%s/nvmem", path, dent->d_name);
|
bytes = asprintf(&nvmem, "%s/%s/nvmem", path, dent->d_name);
|
||||||
|
|
Loading…
Reference in a new issue