xtensa: fix high memory/reserved memory collision
[cris-mirror.git] / fs / proc / util.c
blobb161cfa0f9fa15dce4e2afdc7d71bd0b3925ba3c
1 #include <linux/dcache.h>
3 unsigned name_to_int(const struct qstr *qstr)
5 const char *name = qstr->name;
6 int len = qstr->len;
7 unsigned n = 0;
9 if (len > 1 && *name == '0')
10 goto out;
11 do {
12 unsigned c = *name++ - '0';
13 if (c > 9)
14 goto out;
15 if (n >= (~0U-9)/10)
16 goto out;
17 n *= 10;
18 n += c;
19 } while (--len > 0);
20 return n;
21 out:
22 return ~0U;