cmd: ubi: use void * for buf parameter in ubi_volume_read
Use void * to avoid explicit type casting as what ubi_volume_write has done already. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
This commit is contained in:
committed by
Heiko Schocher
parent
065b0ba3b1
commit
b63af5e2c2
@@ -505,7 +505,7 @@ int ubi_volume_write(const char *volume, const void *buf, loff_t offset,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ubi_volume_read(const char *volume, char *buf, loff_t offset, size_t size)
|
||||
int ubi_volume_read(const char *volume, void *buf, loff_t offset, size_t size)
|
||||
{
|
||||
int err, lnum, off, len, tbuf_size;
|
||||
void *tbuf;
|
||||
@@ -877,7 +877,7 @@ static int do_ubi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
}
|
||||
|
||||
if (argc == 3) {
|
||||
return ubi_volume_read(argv[3], (char *)addr, 0, size);
|
||||
return ubi_volume_read(argv[3], (void *)addr, 0, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,14 +132,14 @@ static int env_ubi_load(void)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
read1_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME, (void *)tmp_env1, 0,
|
||||
read1_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME, tmp_env1, 0,
|
||||
CONFIG_ENV_SIZE);
|
||||
if (read1_fail)
|
||||
printf("\n** Unable to read env from %s:%s **\n",
|
||||
CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME);
|
||||
|
||||
read2_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME_REDUND,
|
||||
(void *)tmp_env2, 0, CONFIG_ENV_SIZE);
|
||||
tmp_env2, 0, CONFIG_ENV_SIZE);
|
||||
if (read2_fail)
|
||||
printf("\n** Unable to read redundant env from %s:%s **\n",
|
||||
CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME_REDUND);
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ void ubi_exit(void);
|
||||
int ubi_part(const char *part_name, const char *vid_header_offset);
|
||||
int ubi_volume_write(const char *volume, const void *buf, loff_t offset,
|
||||
size_t size);
|
||||
int ubi_volume_read(const char *volume, char *buf, loff_t offset, size_t size);
|
||||
int ubi_volume_read(const char *volume, void *buf, loff_t offset, size_t size);
|
||||
|
||||
extern struct ubi_device *ubi_devices[];
|
||||
int cmd_ubifs_mount(char *vol_name);
|
||||
|
||||
Reference in New Issue
Block a user