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

MISRA-C Checking function return #9930

Merged
merged 12 commits into from
Sep 14, 2018
Merged

Commits on Sep 13, 2018

  1. misc: printk: Change function return

    The result of both printk and vprintk are not used in any place.
    MISRA-C says that the return of every non void function must be
    checked.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    c81a763 View commit details
    Browse the repository at this point in the history
  2. kernel: syscall: Explicitly ignoring not used return

    Some syscacll return value through parameters and for these functions
    the return of _arch_syscall_invoke* are not used.
    
    MISRA requires that all return values be checked.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    bfcd047 View commit details
    Browse the repository at this point in the history
  3. kernel: swap: Fix __swap signature

    __swap function was returning -EAGAIN in some case, though its return
    value was declared as unsigned int.
    
    This commit changes this function to return int since it can return a
    negative value and its return was already been propagate as int.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    d5796e7 View commit details
    Browse the repository at this point in the history
  4. kernel: Explicitly ignoring _Swap return

    Ignoring _Swap return where there is no treatment or nothing to do.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    99184f7 View commit details
    Browse the repository at this point in the history
  5. coccicnelle: Ignore return of memset

    The return of memset is never checked. This patch explicitly ignore
    the return to avoid MISRA-C violations.
    
    The only directory excluded directory was ext/* since it contains
    only imported code.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    6bf7d0a View commit details
    Browse the repository at this point in the history
  6. kernel: Ignore _pend_current_thread return in some cases

    There are some cases that there is nothing to do with
    _pend_current_thread() return (that is _Swap return value).
    
    As MISRA-C requires that all non-void functions have their
    return value checked, we are explicitly ignoring it when there is
    nothing to do.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    22e8c14 View commit details
    Browse the repository at this point in the history
  7. kernel: Ignore _abort_timeout return

    Ignoring the return of _abort_timeout when there is nothing to
    do. Either because the condition to return something different from 0
    was prior checked or because it was called during come cleanup.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    b3e87a4 View commit details
    Browse the repository at this point in the history
  8. kernel: atomic: Ignore atomic_and/or return when not used

    There are some cases where atomic_and/or don't need to be
    checked. Actively acknowledge these cases.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    e616303 View commit details
    Browse the repository at this point in the history
  9. kernel: Change _reschedule signature

    _reschedule return's value is not used anywhere, except erroneously by
    pthread_barrier_wait.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    04a802c View commit details
    Browse the repository at this point in the history
  10. kernel: Explicitly check _abort_thread_timemout

    A lot of times this API is called during some cleanup even if the
    timeout was not set to make the code simpler. In these cases it's not
    necessary checking the return. Adding a cast to acknowledge it.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    f47ed76 View commit details
    Browse the repository at this point in the history
  11. kernel: Check k_thread_create return value

    k_thread_create is used only in k_word_q_start that has no error
    handling, so the return of that function is not used.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    8ed4493 View commit details
    Browse the repository at this point in the history
  12. kernel; Checking functions return

    Checking the return of some scattered functions across kernel.
    MISRA-C requires that all non-void functions have their return value
    checked, though, in some cases there is nothing to do. Just
    acknowledging it.
    
    Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
    Flavio Ceolin committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    cde5ff0 View commit details
    Browse the repository at this point in the history