Skip to content

Commit adb982a

Browse files
committed
Merge branch 'for-6.7' into for-linus
2 parents 9277abd + 72fcce7 commit adb982a

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

kernel/printk/printk.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,6 @@ static int syslog_print_all(char __user *buf, int size, bool clear)
16691669

16701670
prb_rec_init_rd(&r, &info, text, PRINTK_MESSAGE_MAX);
16711671

1672-
len = 0;
16731672
prb_for_each_record(seq, prb, seq, &r) {
16741673
int textlen;
16751674

@@ -4194,7 +4193,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dump_iter *iter, bool syslog,
41944193

41954194
prb_rec_init_rd(&r, &info, buf, size);
41964195

4197-
len = 0;
41984196
prb_for_each_record(seq, prb, seq, &r) {
41994197
if (r.info->seq >= iter->next_seq)
42004198
break;

lib/vsprintf.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
bool no_hash_pointers __ro_after_init;
6161
EXPORT_SYMBOL_GPL(no_hash_pointers);
6262

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)
6465
{
6566
const char *cp;
6667
unsigned long long result = 0ULL;
@@ -95,7 +96,7 @@ static noinline unsigned long long simple_strntoull(const char *startp, size_t m
9596
noinline
9697
unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base)
9798
{
98-
return simple_strntoull(cp, INT_MAX, endp, base);
99+
return simple_strntoull(cp, endp, base, INT_MAX);
99100
}
100101
EXPORT_SYMBOL(simple_strtoull);
101102

@@ -130,8 +131,8 @@ long simple_strtol(const char *cp, char **endp, unsigned int base)
130131
}
131132
EXPORT_SYMBOL(simple_strtol);
132133

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)
135136
{
136137
/*
137138
* 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,
140141
* and the content of *cp is irrelevant.
141142
*/
142143
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);
144145

145-
return simple_strntoull(cp, max_chars, endp, base);
146+
return simple_strntoull(cp, endp, base, max_chars);
146147
}
147148

148149
/**
@@ -155,7 +156,7 @@ static long long simple_strntoll(const char *cp, size_t max_chars, char **endp,
155156
*/
156157
long long simple_strtoll(const char *cp, char **endp, unsigned int base)
157158
{
158-
return simple_strntoll(cp, INT_MAX, endp, base);
159+
return simple_strntoll(cp, endp, base, INT_MAX);
159160
}
160161
EXPORT_SYMBOL(simple_strtoll);
161162

@@ -3648,13 +3649,11 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
36483649
break;
36493650

36503651
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);
36543654
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);
36583657

36593658
switch (qualifier) {
36603659
case 'H': /* that's 'hh' in format */

0 commit comments

Comments
 (0)