Except for the added (and sorted) includes, the removal of redundant parentheses, and a few non-string cases that I've left out of the change, this patch can be approximated with the following semantic patch: $ cat ~/tmp/spatch/strneq.sp @@ expression s; @@ - '\0' != *s + !streq(s, "") @@ expression s; @@ - '\0' != s[0] + !streq(s, "") @@ expression s; @@ - *s != '\0' + !streq(s, "") @@ expression s; @@ - s[0] != '\0' + !streq(s, "") $ find contrib/ lib* src/ -type f \ | xargs spatch --in-place --sp-file ~/tmp/spatch/strneq.sp; Signed-off-by: Alejandro Colomar <alx@kernel.org>
2.2 KiB
2.2 KiB