LCOV - code coverage report
Current view: top level - fs/proc - util.c (source / functions) Hit Total Coverage
Test: Real Lines: 11 11 100.0 %
Date: 2020-10-17 15:46:16 Functions: 0 1 0.0 %
Legend: Neither, QEMU, Real, Both Branches: 0 0 -

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

Generated by: LCOV version 1.14