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>
This commit is contained in:
parent
53c47c59e6
commit
de9433550b
2 changed files with 5 additions and 19 deletions
22
fs/fat/fat.c
22
fs/fat/fat.c
|
@ -1243,8 +1243,8 @@ out_free_itr:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||||
loff_t maxsize, loff_t *actread)
|
loff_t *actread)
|
||||||
{
|
{
|
||||||
fsdata fsdata;
|
fsdata fsdata;
|
||||||
fat_itr *itr;
|
fat_itr *itr;
|
||||||
|
@ -1261,12 +1261,12 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free_both;
|
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 */
|
/* For saving default max clustersize memory allocated to malloc pool */
|
||||||
dir_entry *dentptr = itr->dent;
|
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:
|
out_free_both:
|
||||||
free(fsdata.fatbuf);
|
free(fsdata.fatbuf);
|
||||||
|
@ -1280,25 +1280,13 @@ int file_fat_read(const char *filename, void *buffer, int maxsize)
|
||||||
loff_t actread;
|
loff_t actread;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = file_fat_read_at(filename, 0, buffer, maxsize, &actread);
|
ret = fat_read_file(filename, buffer, 0, maxsize, &actread);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
else
|
else
|
||||||
return actread;
|
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 {
|
typedef struct {
|
||||||
struct fs_dir_stream parent;
|
struct fs_dir_stream parent;
|
||||||
struct fs_dirent dirent;
|
struct fs_dirent dirent;
|
||||||
|
|
|
@ -200,8 +200,6 @@ static inline u32 sect_to_clust(fsdata *fsdata, int sect)
|
||||||
int file_fat_detectfs(void);
|
int file_fat_detectfs(void);
|
||||||
int fat_exists(const char *filename);
|
int fat_exists(const char *filename);
|
||||||
int fat_size(const char *filename, loff_t *size);
|
int fat_size(const char *filename, loff_t *size);
|
||||||
int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
|
||||||
loff_t maxsize, loff_t *actread);
|
|
||||||
int file_fat_read(const char *filename, void *buffer, int maxsize);
|
int file_fat_read(const char *filename, void *buffer, int maxsize);
|
||||||
int fat_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
|
int fat_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
|
||||||
int fat_register_device(struct blk_desc *dev_desc, int part_no);
|
int fat_register_device(struct blk_desc *dev_desc, int part_no);
|
||||||
|
|
Loading…
Reference in a new issue