checkpatch: use codespell for odp

By default configure is looking for codespell installed.
That check can be optionally turned off. Code spell can be
used directly from command line or be used for checkpatch.
For now it finds bunch of spelling issues:

./configure.ac:52: archetecture  ==> architecture
./m4/ax_prog_doxygen.m4:24: seperate  ==> separate
./m4/ax_prog_doxygen.m4:464: Seperate  ==> Separate
./m4/ax_prog_doxygen.m4:465: seperate  ==> separate
./doc/api_guide_lines.dox:93: addtion  ==> addition
./doc/api_guide_lines.dox:153: begining  ==> beginning
./scripts/checkpatch.pl:5262: preceeded  ==> preceded
./platform/linux-generic/odp_timer.c:601: occurence  ==> occurrence
./platform/linux-generic/odp_rwlock.c:52: aquired  ==> acquired
./platform/linux-generic/odp_pool.c:164: paramters  ==> parameters
./helper/ring.c:283: preceeded  ==> preceded
./helper/include/odp/helper/ip.h:157: extention  ==> extension
./example/ipsec/odp_ipsec_sa_db.h:17: Assocation  ==> Association
./example/ipsec/odp_ipsec_sa_db.h:32: Assocation  ==> Association
./example/generator/odp_generator.c:537: funtion  ==> function
./include/odp/api/queue.h:44: lenght  ==> length
./include/odp/api/queue.h:216: responsability  ==> responsibility
./include/odp/api/init.h:158: dependant  ==> dependent
./include/odp/api/crypto.h:113: paramters  ==> parameters
./include/odp/api/crypto.h:136: peformed  ==> performed
./include/odp/api/packet_io.h:67: becuase  ==> because
./include/odp/api/pool.h:40: lenght  ==> length
./test/validation/odp_cpumask.c:126: occured  ==> occurred
./test/performance/odp_atomic.c:47: excercise  ==> exercise

Signed-off-by: Maxim Uvarov <[email protected]>
---
 .checkpatch.conf |  1 +
 configure.ac     | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/.checkpatch.conf b/.checkpatch.conf
index 9076410..17fcea6 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -2,3 +2,4 @@
 --strict
 --ignore=NEW_TYPEDEFS
 --ignore=DEPRECATED_VARIABLE
+--codespell
diff --git a/configure.ac b/configure.ac
index d20bad2..73bb97f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,6 +248,26 @@ AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
 AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], 
[],
              [AC_MSG_ERROR([OpenSSL headers required])])
 
+
+##########################################################################
+# Check for Codespell tool
+##########################################################################
+AC_CHECK_PROG([CODESPELL], [codespell], [codespell])
+codespell_disabled=no
+AC_ARG_ENABLE([codespell],
+    [AS_HELP_STRING([--disable-codespell], [Use codespell for checkpatch.])],
+    [case "$withval" in
+     no)  ;;
+     yes) codespell_disabled=yes ;;
+     *)   AC_MSG_ERROR([Bad value ${withval} for --disable-codespell.]) ;;
+     esac])
+
+if test $codespell_disabled == "no" && test -z $CODESPELL
+then
+    AC_MSG_ERROR([Codespell not found. apt-get install codespell or
+                  use --disable-codespell])
+fi
+
 ##########################################################################
 # Restore old saved variables
 ##########################################################################
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to