Skip to content

Commit

Permalink
Take some GP types into account when running patch check tool
Browse files Browse the repository at this point in the history
When running checkpatch on the OP-TEE code, for instance during the
Travis checks, it happens that we get false warnings and errors caused
by the use of GlobalPlatform typedefs. In the following example, the
patch introduces pointers to functions returning TEE_Result, but
checkpatch won't accept it as a valid type:

 $ ./scripts/checkpatch.sh d776721 | tail -1
 total: 1 errors, 5 warnings, 555 lines checked

To address such issues, declare our custom types in a local file
(typedefs.checkpatch) and use the new --typedefsfile option provided by
checkpatch.pl.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
jforissier committed May 10, 2017
1 parent ee664c1 commit 1472c99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/checkpatch_inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ _CP_EXCL=$(for p in $CHECKPATCH_IGNORE; do echo ":(exclude)$p" ; done)

function _checkpatch() {
$CHECKPATCH --quiet --ignore FILE_PATH_CHANGES \
--ignore GERRIT_CHANGE_ID --no-tree -
--ignore GERRIT_CHANGE_ID \
--typedefsfile typedefs.checkpatch --no-tree -
}

function checkpatch() {
Expand Down
2 changes: 2 additions & 0 deletions typedefs.checkpatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TEE_Result
TEE_UUID

0 comments on commit 1472c99

Please sign in to comment.