linux-stable/scripts
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
..
basic
coccinelle Merge branch 'akpm' (patches from Andrew) 2015-09-08 17:52:23 -07:00
dtc
gdb
genksyms
kconfig Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-09-08 14:17:38 -07:00
ksymoops
mod Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-09-08 14:12:19 -07:00
package deb-pkg: add source package 2015-09-04 11:25:03 +02:00
selinux
tracing
.gitignore
analyze_suspend.py
asn1_compiler.c
bloat-o-meter
bootgraph.pl
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: add constant comparison on left side test 2015-09-10 13:29:01 -07:00
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
decode_stacktrace.sh scripts: decode_stacktrace: fix ARM architecture decoding 2015-09-04 16:54:41 -07:00
decodecode
depmod.sh
diffconfig
docproc.c
export_report.pl
extract-cert.c
extract-ikconfig
extract-vmlinux
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_maintainer.pl
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
kallsyms.c
Kbuild.include Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-09-08 14:12:19 -07:00
kernel-doc kerneldoc: Convert error messages to GNU error message format 2015-09-04 16:54:41 -07:00
kernel-doc-xml-ref
ld-version.sh
Lindent scripts/Lindent: handle missing indent gracefully 2015-09-04 16:54:41 -07:00
link-vmlinux.sh
Makefile
Makefile.asm-generic
Makefile.build
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn kbuild: Fix clang detection 2015-09-04 13:14:10 +02:00
Makefile.fwinst
Makefile.headersinst
Makefile.help
Makefile.host
Makefile.kasan
Makefile.lib
Makefile.modbuiltin
Makefile.modinst
Makefile.modpost
Makefile.modsign
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
mkversion
module-common.lds
namespace.pl
objdiff
patch-kernel
pnmtologo.c
profile2linkerlist.pl
recordmcount.c
recordmcount.h
recordmcount.pl
setlocalversion
show_delta
sign-file.c
sortextable.c
sortextable.h
spelling.txt scripts/spelling.txt: add some typo-words 2015-09-04 16:54:41 -07:00
stackdelta
stackusage
tags.sh Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-09-08 14:23:13 -07:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh