summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeijie Gao <[email protected]>2026-05-20 16:27:30 +0800
committerHeiko Schocher <[email protected]>2026-07-08 11:29:55 +0200
commitb63af5e2c20cc9d2d510c5ff38d48114582d410d (patch)
tree3bf2e0beef8283f05bdf374ac24af95933f1bc42
parent065b0ba3b14fd6795626b89d5e8e3daede02475a (diff)
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 <[email protected]> Signed-off-by: Weijie Gao <[email protected]>
-rw-r--r--cmd/ubi.c4
-rw-r--r--env/ubi.c4
-rw-r--r--include/ubi_uboot.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/cmd/ubi.c b/cmd/ubi.c
index f75ceff11ee..8e3cfaaddbb 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -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);
}
}
diff --git a/env/ubi.c b/env/ubi.c
index e9865b45ebc..46970ba754f 100644
--- a/env/ubi.c
+++ b/env/ubi.c
@@ -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);
diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
index a949d1b80dd..dd22ec7537a 100644
--- a/include/ubi_uboot.h
+++ b/include/ubi_uboot.h
@@ -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);