LCOV - code coverage report
Current view: top level - arch/um/include/asm - archrandom.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 3 100.0 %
Date: 2023-03-27 20:00:47 Functions: 0 0 -

          Line data    Source code
       1             : /* SPDX-License-Identifier: GPL-2.0 */
       2             : #ifndef __ASM_UM_ARCHRANDOM_H__
       3             : #define __ASM_UM_ARCHRANDOM_H__
       4             : 
       5             : #include <linux/types.h>
       6             : 
       7             : /* This is from <os.h>, but better not to #include that in a global header here. */
       8             : ssize_t os_getrandom(void *buf, size_t len, unsigned int flags);
       9             : 
      10             : static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
      11             : {
      12             :         ssize_t ret;
      13             : 
      14          12 :         ret = os_getrandom(v, max_longs * sizeof(*v), 0);
      15          12 :         if (ret < 0)
      16             :                 return 0;
      17          12 :         return ret / sizeof(*v);
      18             : }
      19             : 
      20             : static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
      21             : {
      22             :         return 0;
      23             : }
      24             : 
      25             : #endif

Generated by: LCOV version 1.14