]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: ubifs: mark string parameters with const
authorWeijie Gao <weijie.gao@mediatek.com>
Wed, 20 May 2026 08:27:31 +0000 (16:27 +0800)
committerHeiko Schocher <hs@nabladev.com>
Wed, 8 Jul 2026 09:30:14 +0000 (11:30 +0200)
File name and volume name should be const as they will not be modified in
these functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
cmd/ubifs.c
fs/ubifs/super.c
fs/ubifs/ubifs.c
include/ubi_uboot.h
include/ubifs_uboot.h

index 22e95db8ca58c6a21e49aad388f91408b86a8ef1..81f2d37fc7bee50d542592d1cecd53f9b8a4f219 100644 (file)
@@ -19,7 +19,7 @@
 static int ubifs_initialized;
 static int ubifs_mounted;
 
-int cmd_ubifs_mount(char *vol_name)
+int cmd_ubifs_mount(const char *vol_name)
 {
        int ret;
 
index b6004b88f4ea215fbdd41ec97da5f28d1eb5e96c..9c8974a97a57ec0e106155eaaf9f9cc969bd0464 100644 (file)
@@ -2694,7 +2694,7 @@ MODULE_VERSION(__stringify(UBIFS_VERSION));
 MODULE_AUTHOR("Artem Bityutskiy, Adrian Hunter");
 MODULE_DESCRIPTION("UBIFS - UBI File System");
 #else
-int uboot_ubifs_mount(char *vol_name)
+int uboot_ubifs_mount(const char *vol_name)
 {
        struct dentry *ret;
        int flags;
index 59bc754730417bccf40e598bb753dbd9bcde64fe..6121fb0b1350d3ad41a0d09019e509dd8fd37c50 100644 (file)
@@ -991,7 +991,7 @@ void ubifs_close(void)
 }
 
 /* Compat wrappers for common/cmd_ubifs.c */
-int ubifs_load(char *filename, unsigned long addr, u32 size)
+int ubifs_load(const char *filename, unsigned long addr, u32 size)
 {
        loff_t actread;
        int err;
index dd22ec7537ac570f244238a9d4697a140e4008b3..6ebd8a3b613ab0647d8b01f5786fb16597d1aff9 100644 (file)
@@ -53,7 +53,7 @@ int ubi_volume_write(const char *volume, const void *buf, loff_t offset,
 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);
+int cmd_ubifs_mount(const char *vol_name);
 int cmd_ubifs_umount(void);
 
 #if IS_ENABLED(CONFIG_UBI_BLOCK)
index db8a29e9bbd8e9a570669179f9b03567c77bbf9a..0877dd84f9975a36bacc8ab6ba1fbc4346d82832 100644 (file)
@@ -18,10 +18,10 @@ struct blk_desc;
 struct disk_partition;
 
 int ubifs_init(void);
-int uboot_ubifs_mount(char *vol_name);
+int uboot_ubifs_mount(const char *vol_name);
 void uboot_ubifs_umount(void);
 int ubifs_is_mounted(void);
-int ubifs_load(char *filename, unsigned long addr, u32 size);
+int ubifs_load(const char *filename, unsigned long addr, u32 size);
 
 int ubifs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info);
 int ubifs_ls(const char *dir_name);