[LTP] [COMMITTED] save_restore: remove the duplicate 'const' declaration

Li Wang liwang@redhat.com
Thu Mar 10 09:58:14 CET 2022


On Thu, Mar 10, 2022 at 4:53 PM xuyang2018.jy@fujitsu.com <
xuyang2018.jy@fujitsu.com> wrote:

> Hi Li
> >
> >
> > On Thu, Mar 10, 2022 at 4:38 PM xuyang2018.jy@fujitsu.com
> > <mailto:xuyang2018.jy@fujitsu.com> <xuyang2018.jy@fujitsu.com
> > <mailto:xuyang2018.jy@fujitsu.com>> wrote:
> >
> >     Hi Li
> >      > --- a/lib/newlib_tests/test19.c
> >      > +++ b/lib/newlib_tests/test19.c
> >      > @@ -23,7 +23,7 @@ static struct tst_test test = {
> >      > .needs_root = 1,
> >      > .test_all = run,
> >      > .setup = setup,
> >      > - .save_restore = (const struct tst_path_val const[]) {
> >      > + .save_restore = (const struct tst_path_val[]) {
> >      > {"?/proc/nonexistent", NULL},
> >      > {"!/proc/sys/kernel/numa_balancing", NULL},
> >      > {"/proc/sys/kernel/core_pattern", NULL},
> >
> >     Since tst_path_val is a struct array, we should use {NULL, NULL} or
> {}
> >     terminated instead of NULL terminated , otherwise it will report
> >     missing
> >     braces warning.
> >
> > Ah, right. Sorry!!!
> Never mind.
> >
> > Seems I was in so hurry to fix the const issue but overlook this.
> I also think you can add a separate patch to fix this comment in doc or
> in  tst_test.h for other struct pointers.
>

You are right. I will go through the whole part to see if other places need
updates.

Thanks for finding this :).



>
>          /*
>           * NULL-terminated array to be allocated buffers.
>           */
>          struct tst_buffers *bufs;
>
>          /*
>           * NULL-terminated array of capability settings
>           */
>          struct tst_cap *caps;
>
> Best Regards
> Yang Xu
> >
> > --
> > Regards,
> > Li Wang
>


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220310/7265d33f/attachment-0001.htm>


More information about the ltp mailing list