LCOV - code coverage report
Current view: top level - fs/proc - util.c (source / functions) Hit Total Coverage
Test: landlock.info Lines: 14 16 87.5 %
Date: 2021-04-22 12:43:58 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include <linux/dcache.h>
       2             : #include "internal.h"
       3             : 
       4         438 : unsigned name_to_int(const struct qstr *qstr)
       5             : {
       6         438 :         const char *name = qstr->name;
       7         438 :         int len = qstr->len;
       8         438 :         unsigned n = 0;
       9             : 
      10         438 :         if (len > 1 && *name == '0')
      11           0 :                 goto out;
      12         839 :         do {
      13         839 :                 unsigned c = *name++ - '0';
      14         839 :                 if (c > 9)
      15         141 :                         goto out;
      16         698 :                 if (n >= (~0U-9)/10)
      17           0 :                         goto out;
      18         698 :                 n *= 10;
      19         698 :                 n += c;
      20         698 :         } while (--len > 0);
      21             :         return n;
      22         438 : out:
      23             :         return ~0U;
      24             : }

Generated by: LCOV version 1.14