[PATCH v2 02/83] devtools/cocci: add script to fix unnecessary null checks
Thomas Monjalon
thomas at monjalon.net
Fri Jan 28 22:48:09 CET 2022
24/01/2022 18:45, Stephen Hemminger:
> This script is based on the idea of the nullfree script
> in the Linux kernel. It finds cases where a check for null
> pointer is done, but is unnecessary because the function
> already handles NULL pointer.
>
> Basic example:
> if (x->buf)
> rte_free(x->buf);
> can be reduced to:
> rte_free(x->buf);
>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Good to have, thank you.
More information about the dev
mailing list