Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: coccinelle #3991

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Jun 27, 2020

  1. scripts: add coccinelle support

    Coccinelle is a utility tool used to match specific code patterns in
    order to modify or statically analyze them.
    ".cocci"scripts (Semantic Patches) are used to define such patterns and
    also to specify what actions have to be performed.
    Add script coccicheck, which allows to execute Coccinelle semantic
    patches on top of op-tee source code.
    It is called using the "coccicheck" target in the op-tee Makefile.
    The script invokes semantic patches in 3 fashions:
    	- use a single semantic patch: specify and execute a single
    	  semantic patch from the local set.
    	- use multiple semantic patches: execute all semantic patches
    	  from the local set.
    	- use a subset of external patches: specify a single or
    	  multiple semantic patches, defined outside of the local set.
    
    Reviewed-by: Paolo Valente <[email protected]>
    Signed-off-by: Andrea Tagliavini <[email protected]>
    AndreaTagliavini committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    554ea08 View commit details
    Browse the repository at this point in the history
  2. scripts:coccinelle: add bad_null

    Add a semantic patch that matches various boolean expressions that
    compare to NULL, and produces patches that replace them with an
    equivalent reduced form (e.g. "foo == NULL" becomes "!foo").
    
    Reviewed-by: Paolo Valente <[email protected]>
    Signed-off-by: Andrea Tagliavini <[email protected]>
    AndreaTagliavini committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    1282557 View commit details
    Browse the repository at this point in the history
  3. scripts:coccinelle: add initialize_variables

    Add a semantic patch that matches non-initialized variables and produces
    patches that set values depending on the variable type.
      - Numeric variables are set to 0
      - Size_t arrays are set to {0}
      - Other arrays are set to {NULL}
      - Every other variable is set to NULL
    
    Reviewed-by: Paolo Valente <[email protected]>
    Signed-off-by: Andrea Tagliavini <[email protected]>
    AndreaTagliavini committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    2059934 View commit details
    Browse the repository at this point in the history
  4. scripts:coccinelle: add warning_overflow

    Add a semantic patch that matches the following construct:
      if(A + B > C)
    For each occurrence of the construct, a warning is printed, in order to
    highlight possible overflows.
    
    Reviewed-by: Paolo Valente <[email protected]>
    Signed-off-by: Andrea Tagliavini <[email protected]>
    AndreaTagliavini committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    a5fe687 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2020

  1. scripts: coccicheck

    Add SPDX-License-Identifier.
    Add option USE_SUBTREE, which let one run semantic patches on a
    specific directory instead of the whole tree.
    
    Signed-off-by: Andrea Tagliavini <[email protected]>
    AndreaTagliavini committed Jul 22, 2020
    Configuration menu
    Copy the full SHA
    f16582e View commit details
    Browse the repository at this point in the history
  2. scripts: coccinelle

    Add SPDX-License-Identifier to semantic patches.
    
    Signed-off-by: Andrea Tagliavini <[email protected]>
    AndreaTagliavini committed Jul 22, 2020
    Configuration menu
    Copy the full SHA
    2c8faba View commit details
    Browse the repository at this point in the history