repo.or.cz
/
linux
/
fpc-iii.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge tag 'icc-5.4-rc1' of https://git.linaro.org/people/georgi.djakov/linux into...
[linux/fpc-iii.git]
/
fs
/
proc
/
util.c
blob
98f8adc17345311c25a18708079d554e833e894c
1
#include <linux/dcache.h>
2
#include
"internal.h"
3
4
unsigned
name_to_int
(
const struct
qstr
*
qstr
)
5
{
6
const char
*
name
=
qstr
->
name
;
7
int
len
=
qstr
->
len
;
8
unsigned
n
=
0
;
9
10
if
(
len
>
1
&& *
name
==
'0'
)
11
goto
out
;
12
do
{
13
unsigned
c
= *
name
++ -
'0'
;
14
if
(
c
>
9
)
15
goto
out
;
16
if
(
n
>= (~
0U
-
9
)/
10
)
17
goto
out
;
18
n
*=
10
;
19
n
+=
c
;
20
}
while
(--
len
>
0
);
21
return
n
;
22
out
:
23
return
~
0U
;
24
}