[PATCH 1/3] cmd: ubi: expose more APIs to public
Weijie Gao
weijie.gao at mediatek.com
Mon Apr 20 09:18:56 CEST 2026
On Sat, 2026-04-18 at 12:47 +1200, Simon Glass wrote:
> Hi Weijie,
>
> On 2026-04-17T02:35:14, Weijie Gao <weijie.gao at mediatek.com> wrote:
> > cmd: ubi: expose more APIs to public
> >
> > Export ubi_detach/ubi_create_vol/ubi_find_volume/ubi_remove_vol to
> > public for better ubi manipulation used by other modules.
> >
> > Signed-off-by: Weijie Gao <weijie.gao at mediatek.com>
> >
> > cmd/ubi.c | 10 +++++-----
> > include/ubi_uboot.h | 5 +++++
> > 2 files changed, 10 insertions(+), 5 deletions(-)
> > diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
> > @@ -47,9 +47,14 @@
> > +extern int ubi_create_vol(char *volume, int64_t size, int dynamic,
> > int vol_id,
> > + bool skipcheck);
> > +extern struct ubi_volume *ubi_find_volume(char *volume);
> > +extern int ubi_remove_vol(char *volume);
>
> The volume parameter should be const char * since these functions do
> not modify the string. In patch 3/3, env_ubi_volume_create() receives
> a const char * and has to cast away const when calling these
> functions. Please can you fix the signatures in both cmd/ubi.c and
> ubi_uboot.h to take const char *volume.
OK. We need another patch to change all existing functions with char *
to const char *.
>
> Regards,
> Simon
More information about the U-Boot
mailing list