Skip to content

Commit e9c063c

Browse files
mdrustadsfrothwell
authored andcommitted
init/initramfs.c: resolve shadow warnings
Resolve shadow warnings that are produced in W=2 builds by renaming a global with a too-generic name and renaming a formal parameter. Signed-off-by: Mark Rustad <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 95c72f2 commit e9c063c

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

init/initramfs.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ static __initdata enum state {
197197
} state, next_state;
198198

199199
static __initdata char *victim;
200-
static unsigned long count __initdata;
200+
static unsigned long byte_count __initdata;
201201
static __initdata loff_t this_header, next_header;
202202

203203
static inline void __init eat(unsigned n)
204204
{
205205
victim += n;
206206
this_header += n;
207-
count -= n;
207+
byte_count -= n;
208208
}
209209

210210
static __initdata char *vcollected;
@@ -214,7 +214,7 @@ static __initdata char *collect;
214214

215215
static void __init read_into(char *buf, unsigned size, enum state next)
216216
{
217-
if (count >= size) {
217+
if (byte_count >= size) {
218218
collected = victim;
219219
eat(size);
220220
state = next;
@@ -237,8 +237,8 @@ static int __init do_start(void)
237237
static int __init do_collect(void)
238238
{
239239
unsigned long n = remains;
240-
if (count < n)
241-
n = count;
240+
if (byte_count < n)
241+
n = byte_count;
242242
memcpy(collect, victim, n);
243243
eat(n);
244244
collect += n;
@@ -280,8 +280,8 @@ static int __init do_header(void)
280280

281281
static int __init do_skip(void)
282282
{
283-
if (this_header + count < next_header) {
284-
eat(count);
283+
if (this_header + byte_count < next_header) {
284+
eat(byte_count);
285285
return 1;
286286
} else {
287287
eat(next_header - this_header);
@@ -292,9 +292,9 @@ static int __init do_skip(void)
292292

293293
static int __init do_reset(void)
294294
{
295-
while(count && *victim == '\0')
295+
while(byte_count && *victim == '\0')
296296
eat(1);
297-
if (count && (this_header & 3))
297+
if (byte_count && (this_header & 3))
298298
error("broken padding");
299299
return 1;
300300
}
@@ -309,11 +309,11 @@ static int __init maybe_link(void)
309309
return 0;
310310
}
311311

312-
static void __init clean_path(char *path, umode_t mode)
312+
static void __init clean_path(char *path, umode_t fmode)
313313
{
314314
struct stat st;
315315

316-
if (!sys_newlstat(path, &st) && (st.st_mode^mode) & S_IFMT) {
316+
if (!sys_newlstat(path, &st) && (st.st_mode ^ fmode) & S_IFMT) {
317317
if (S_ISDIR(st.st_mode))
318318
sys_rmdir(path);
319319
else
@@ -368,7 +368,7 @@ static int __init do_name(void)
368368

369369
static int __init do_copy(void)
370370
{
371-
if (count >= body_len) {
371+
if (byte_count >= body_len) {
372372
if (xwrite(wfd, victim, body_len) != body_len)
373373
error("write error");
374374
sys_close(wfd);
@@ -378,10 +378,10 @@ static int __init do_copy(void)
378378
state = SkipIt;
379379
return 0;
380380
} else {
381-
if (xwrite(wfd, victim, count) != count)
381+
if (xwrite(wfd, victim, byte_count) != byte_count)
382382
error("write error");
383-
body_len -= count;
384-
eat(count);
383+
body_len -= byte_count;
384+
eat(byte_count);
385385
return 1;
386386
}
387387
}
@@ -411,12 +411,12 @@ static __initdata int (*actions[])(void) = {
411411

412412
static long __init write_buffer(char *buf, unsigned long len)
413413
{
414-
count = len;
414+
byte_count = len;
415415
victim = buf;
416416

417417
while (!actions[state]())
418418
;
419-
return len - count;
419+
return len - byte_count;
420420
}
421421

422422
static long __init flush_buffer(void *bufv, unsigned long len)

0 commit comments

Comments
 (0)