60
60
bool no_hash_pointers __ro_after_init ;
61
61
EXPORT_SYMBOL_GPL (no_hash_pointers );
62
62
63
- static noinline unsigned long long simple_strntoull (const char * startp , size_t max_chars , char * * endp , unsigned int base )
63
+ noinline
64
+ static unsigned long long simple_strntoull (const char * startp , char * * endp , unsigned int base , size_t max_chars )
64
65
{
65
66
const char * cp ;
66
67
unsigned long long result = 0ULL ;
@@ -95,7 +96,7 @@ static noinline unsigned long long simple_strntoull(const char *startp, size_t m
95
96
noinline
96
97
unsigned long long simple_strtoull (const char * cp , char * * endp , unsigned int base )
97
98
{
98
- return simple_strntoull (cp , INT_MAX , endp , base );
99
+ return simple_strntoull (cp , endp , base , INT_MAX );
99
100
}
100
101
EXPORT_SYMBOL (simple_strtoull );
101
102
@@ -130,8 +131,8 @@ long simple_strtol(const char *cp, char **endp, unsigned int base)
130
131
}
131
132
EXPORT_SYMBOL (simple_strtol );
132
133
133
- static long long simple_strntoll ( const char * cp , size_t max_chars , char * * endp ,
134
- unsigned int base )
134
+ noinline
135
+ static long long simple_strntoll ( const char * cp , char * * endp , unsigned int base , size_t max_chars )
135
136
{
136
137
/*
137
138
* simple_strntoull() safely handles receiving max_chars==0 in the
@@ -140,9 +141,9 @@ static long long simple_strntoll(const char *cp, size_t max_chars, char **endp,
140
141
* and the content of *cp is irrelevant.
141
142
*/
142
143
if (* cp == '-' && max_chars > 0 )
143
- return - simple_strntoull (cp + 1 , max_chars - 1 , endp , base );
144
+ return - simple_strntoull (cp + 1 , endp , base , max_chars - 1 );
144
145
145
- return simple_strntoull (cp , max_chars , endp , base );
146
+ return simple_strntoull (cp , endp , base , max_chars );
146
147
}
147
148
148
149
/**
@@ -155,7 +156,7 @@ static long long simple_strntoll(const char *cp, size_t max_chars, char **endp,
155
156
*/
156
157
long long simple_strtoll (const char * cp , char * * endp , unsigned int base )
157
158
{
158
- return simple_strntoll (cp , INT_MAX , endp , base );
159
+ return simple_strntoll (cp , endp , base , INT_MAX );
159
160
}
160
161
EXPORT_SYMBOL (simple_strtoll );
161
162
@@ -3648,13 +3649,11 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
3648
3649
break ;
3649
3650
3650
3651
if (is_sign )
3651
- val .s = simple_strntoll (str ,
3652
- field_width >= 0 ? field_width : INT_MAX ,
3653
- & next , base );
3652
+ val .s = simple_strntoll (str , & next , base ,
3653
+ field_width >= 0 ? field_width : INT_MAX );
3654
3654
else
3655
- val .u = simple_strntoull (str ,
3656
- field_width >= 0 ? field_width : INT_MAX ,
3657
- & next , base );
3655
+ val .u = simple_strntoull (str , & next , base ,
3656
+ field_width >= 0 ? field_width : INT_MAX );
3658
3657
3659
3658
switch (qualifier ) {
3660
3659
case 'H' : /* that's 'hh' in format */
0 commit comments