LCOV - code coverage report
Current view: top level - fs/proc - util.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 11 63.6 %
Date: 2023-04-06 08:38:28 Functions: 1 1 100.0 %

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

Generated by: LCOV version 1.14