Joe Perches c5595fa2f1 checkpatch: add constant comparison on left side test
"CONST <comparison> variable" checks like:

        if (NULL != foo)
and
        while (0 < bar(...))

where a constant (or what appears to be a constant like an upper case
identifier) is on the left of a comparison are generally preferred to be
written using the constant on the right side like:

        if (foo != NULL)
and
        while (bar(...) > 0)

Add a test for this.

Add a --fix option too, but only do it when the code is immediately
surrounded by parentheses to avoid misfixing things like "(0 < bar() +
constant)"

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Nicolas Morey Chaisemartin <nmorey@kalray.eu>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-10 13:29:01 -07:00
..
2015-08-20 14:57:47 +02:00
2015-09-04 11:25:03 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2011-08-31 16:12:17 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2012-06-27 12:44:29 -07:00
2010-03-23 12:26:38 +01:00
2014-12-20 00:01:12 +01:00
2015-09-04 13:14:10 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2015-08-28 17:04:40 +02:00
2015-08-28 17:04:40 +02:00
2014-08-20 16:03:45 +02:00