Re: [PATCH v2 02/83] devtools/cocci: add script to fix unnecessary null checks

2022-01-28 Thread Thomas Monjalon
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) >

[PATCH v2 02/83] devtools/cocci: add script to fix unnecessary null checks

2022-01-24 Thread 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_fre