LCOV - code coverage report
Current view: top level - include/linux - kasan-checks.h (source / functions) Hit Total Coverage
Test: combined.info Lines: 4 4 100.0 %
Date: 2022-03-28 16:04:14 Functions: 0 0 -
Branches: 13 62 21.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: GPL-2.0 */
       2                 :            : #ifndef _LINUX_KASAN_CHECKS_H
       3                 :            : #define _LINUX_KASAN_CHECKS_H
       4                 :            : 
       5                 :            : #include <linux/types.h>
       6                 :            : 
       7                 :            : /*
       8                 :            :  * __kasan_check_*: Always available when KASAN is enabled. This may be used
       9                 :            :  * even in compilation units that selectively disable KASAN, but must use KASAN
      10                 :            :  * to validate access to an address.   Never use these in header files!
      11                 :            :  */
      12                 :            : #ifdef CONFIG_KASAN
      13                 :            : bool __kasan_check_read(const volatile void *p, unsigned int size);
      14                 :            : bool __kasan_check_write(const volatile void *p, unsigned int size);
      15                 :            : #else
      16                 :            : static inline bool __kasan_check_read(const volatile void *p, unsigned int size)
      17                 :            : {
      18                 :            :         return true;
      19                 :            : }
      20                 :            : static inline bool __kasan_check_write(const volatile void *p, unsigned int size)
      21                 :            : {
      22                 :            :         return true;
      23                 :            : }
      24                 :            : #endif
      25                 :            : 
      26                 :            : /*
      27                 :            :  * kasan_check_*: Only available when the particular compilation unit has KASAN
      28                 :            :  * instrumentation enabled. May be used in header files.
      29                 :            :  */
      30                 :            : #ifdef __SANITIZE_ADDRESS__
      31                 :            : #define kasan_check_read __kasan_check_read
      32                 :            : #define kasan_check_write __kasan_check_write
      33                 :            : #else
      34                 :    1195915 : static inline bool kasan_check_read(const volatile void *p, unsigned int size)
      35                 :            : {
      36   [ +  +  +  +  :    1195902 :         return true;
          +  -  -  -  -  
          -  -  -  -  -  
          -  -  +  +  +  
          +  -  +  -  -  
          -  -  -  -  +  
          -  -  -  -  -  
          -  +  -  -  -  
          -  -  -  -  -  
          -  -  -  -  -  
          -  -  -  -  -  
             -  -  -  - ]
      37                 :            : }
      38                 :    2006748 : static inline bool kasan_check_write(const volatile void *p, unsigned int size)
      39                 :            : {
      40   [ +  -  -  - ]:    1419941 :         return true;
      41                 :            : }
      42                 :            : #endif
      43                 :            : 
      44                 :            : #endif

Generated by: LCOV version 1.14