Message ID | 1459891815.6715.15.camel@perches.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 04/05, Joe Perches wrote: > > There are several of these: [...] > > Maybe a new checkpatch test like: Looks good to me.
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e3d9c34..25e81b9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5734,6 +5734,13 @@ sub process { } } +# check for IS_ERR with likely + + if ($line =~ /\b((?:un)?likely)\s*\(\s*\!?\s*IS_ERR\s*\(/) { + WARN("IS_ERR_IS_UNLIKELY", + "Using $1 isn't recommended as IS_ERR already uses unlikely\n" . $herecurr); + } + # check for semaphores initialized locked if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { WARN("CONSIDER_COMPLETION",