Skip to content

Commit

Permalink
mm/huge_memory.c: rename shadowed local
Browse files Browse the repository at this point in the history
split_huge_pages_write() has a lccal `buf' which shadows incoming arg
`buf'.  Reviewer confusion resulted.  Rename the inner local to `tok_buf'.

Cc: Leo Stone <leocstone@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Andrew Morton committed Jan 26, 2025
1 parent 7e8c8fd commit 1fc1065
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -4181,20 +4181,21 @@ static ssize_t split_huge_pages_write(struct file *file, const char __user *buf,

if (input_buf[0] == '/') {
char *tok;
char *buf = input_buf;
char *tok_buf = input_buf;
char file_path[MAX_INPUT_BUF_SZ];
pgoff_t off_start = 0, off_end = 0;
size_t input_len = strlen(input_buf);

tok = strsep(&buf, ",");
if (tok && buf) {
tok = strsep(&tok_buf, ",");
if (tok && tok_buf) {
strscpy(file_path, tok);
} else {
ret = -EINVAL;
goto out;
}

ret = sscanf(buf, "0x%lx,0x%lx,%d", &off_start, &off_end, &new_order);
ret = sscanf(tok_buf, "0x%lx,0x%lx,%d", &off_start,
&off_end, &new_order);
if (ret != 2 && ret != 3) {
ret = -EINVAL;
goto out;
Expand Down

0 comments on commit 1fc1065

Please sign in to comment.