[PATCH 1/3] cmd: ubi: expose more APIs to public
Simon Glass
sjg at chromium.org
Mon Apr 20 21:32:15 CEST 2026
Hi Weijie,
On Mon, 20 Apr 2026 at 19:19, Weijie Gao <weijie.gao at mediatek.com> wrote:
>
> 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 *.
Yes that sounds like a good idea.
Regards,
Simon
More information about the U-Boot
mailing list