Richard Henderson <richard.hender...@linaro.org> wrote:
> Allow the array of pointers to itself be const.
> Propagate this through the copies of this field.
>
> Signed-off-by: Richard Henderson <richard.hender...@linaro.org>

Reviewed-by: Juan Quintela <quint...@redhat.com>

>  static const VMStateDescription *
> -vmstate_get_subsection(const VMStateDescription **sub, char *idstr)
> +vmstate_get_subsection(const VMStateDescription * const *sub,
> +                       const char *idstr)
>  {
> -    while (sub && *sub) {
> -        if (strcmp(idstr, (*sub)->name) == 0) {
> -            return *sub;
> +    if (sub) {
> +        const VMStateDescription *s;
> +        for (s = *sub; s ; s = *++sub) {

If you have to resubmit, please consider:

        for (const VMStateDescription *s = *sub; s ; s = *++sub) {


I think it makes clearer that the variable is not used out of the for.


Reply via email to