X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=devtools%2Fcheckpatches.sh;h=158087f1ca1f05f0955e59061b7c33b647dbd519;hb=c79a1c67465d0193b52e2ae4b64dd8362c575b2b;hp=179446837666fe7d41c32f3e564aa8b6bec1d03a;hpb=7b6875ba6f37b32997d25e5e43ce62e99ca10597;p=dpdk.git diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 1794468376..158087f1ca 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -61,6 +61,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # refrain from using compiler attribute without defining a common macro + awk -v FOLDERS="lib drivers app examples" \ + -v EXPRESSIONS="__attribute__" \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using compiler attribute directly' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + # svg figures must be included with wildcard extension # because of png conversion for pdf docs awk -v FOLDERS='doc' \ @@ -70,6 +78,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # links must prefer https over http + awk -v FOLDERS='doc' \ + -v EXPRESSIONS='http://.*dpdk.org' \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using non https link to dpdk.org' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + return $res } @@ -103,6 +119,37 @@ check_experimental_tags() { # return $res } +check_internal_tags() { # + res=0 + + cat "$1" |awk ' + BEGIN { + current_file = ""; + ret = 0; + } + /^+++ b\// { + current_file = $2; + } + /^+.*__rte_internal/ { + if (current_file ~ ".c$" ) { + print "Please only put __rte_internal tags in " \ + "headers ("current_file")"; + ret = 1; + } + if ($1 != "+__rte_internal" || $2 != "") { + print "__rte_internal must appear alone on the line" \ + " immediately preceding the return type of" \ + " a function." + ret = 1; + } + } + END { + exit ret; + }' || res=1 + + return $res +} + number=0 range='origin/master..' quiet=false @@ -186,6 +233,14 @@ check () { # ret=1 fi + ! $verbose || printf '\nChecking __rte_internal tags:\n' + report=$(check_internal_tags "$tmpinput") + if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" + printf '%s\n' "$report" + ret=1 + fi + if [ "$tmpinput" != "$1" ]; then rm -f "$tmpinput" trap - INT