On Fri, Sep 16, 2022 at 5:02 AM Liang He <[email protected]> wrote:
> At 2022-09-16 07:29:06, "Srivatsa S. Bhat" <[email protected]> wrote:
> >On 9/14/22 7:23 PM, Liang He wrote:
..
> >> static inline bool jailhouse_paravirt(void)
> >> {
> >> - return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
> >> + struct device_node *np = of_find_compatible_node(NULL, NULL,
> >> "jailhouse,cell");
> >> +
> >> + of_node_put(np);
> >> +
> >> + return np;
> >> }
> >
> >Thank you for the fix, but returning a pointer from a function with a
> >bool return type looks odd. Can we also fix that up please?
> >
>
> Thanks for your review, how about following patch:
>
> - return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
> + struct device_node *np = of_find_compatible_node(NULL, NULL,
> "jailhouse,cell");
> +
> + of_node_put(np);
> +
> + return (np==NULL);
This will be opposite to the above. Perhaps you wanted
return !!np;
Also possible (but why?)
return np ? true : false;
--
With Best Regards,
Andy Shevchenko
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/CAHp75Vd-ZdHJfjdgob7%3De3X_%3DNQR_chWZzTiSVU64S9eTiAY0g%40mail.gmail.com.