summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-19 17:37:40 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-20 18:38:52 +0300
commitde9433550b01547c3207de9f7060092242c91569 (patch)
tree66d95ac2cb225563968eb63f775b74e936634426 /fs
parent53c47c59e638cc118c272235db516bb541dad0ac (diff)
downloadu-boot-de9433550b01547c3207de9f7060092242c91569.tar.xz
fs/fat: avoid noisy message fat_read_file()
UEFI applications call file system functions to determine if a file exists. The return codes are evaluated to show appropriate messages. U-Boot's file system layer should not interfere with the output. Rename file_fat_read_at() to fat_read_file() adjusting the parameter sequence and names and eliminate the old wrapper function. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index a945904785..2da93dae3c 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1243,8 +1243,8 @@ out_free_itr:
return ret;
}
-int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
- loff_t maxsize, loff_t *actread)
+int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
+ loff_t *actread)
{
fsdata fsdata;
fat_itr *itr;
@@ -1261,12 +1261,12 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
if (ret)
goto out_free_both;
- debug("reading %s at pos %llu\n", filename, pos);
+ debug("reading %s at pos %llu\n", filename, offset);
/* For saving default max clustersize memory allocated to malloc pool */
dir_entry *dentptr = itr->dent;
- ret = get_contents(&fsdata, dentptr, pos, buffer, maxsize, actread);
+ ret = get_contents(&fsdata, dentptr, offset, buf, len, actread);
out_free_both:
free(fsdata.fatbuf);
@@ -1280,25 +1280,13 @@ int file_fat_read(const char *filename, void *buffer, int maxsize)
loff_t actread;
int ret;
- ret = file_fat_read_at(filename, 0, buffer, maxsize, &actread);
+ ret = fat_read_file(filename, buffer, 0, maxsize, &actread);
if (ret)
return ret;
else
return actread;
}
-int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
- loff_t *actread)
-{
- int ret;
-
- ret = file_fat_read_at(filename, offset, buf, len, actread);
- if (ret)
- printf("** Unable to read file %s **\n", filename);
-
- return ret;
-}
-
typedef struct {
struct fs_dir_stream parent;
struct fs_dirent dirent;