Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Browse files Browse the repository at this point in the history
Pull sparc updates from David Miller:
 "sparc changes, including a bug fix for handling exceptions during
  bzero on some sparc64 cpus"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: fix fault handling in NGbzero.S and GENbzero.S
  sparc: use memdup_user_nul in sun4m LED driver
  sparc: Remove redundant tests in boot_flags_init().
  • Loading branch information
Linus Torvalds committed May 9, 2017
2 parents 50fb55d + 3c7f622 commit 7fc22f4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
6 changes: 6 additions & 0 deletions arch/sparc/kernel/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -939,3 +939,9 @@ ENTRY(__retl_o1)
retl
mov %o1, %o0
ENDPROC(__retl_o1)

ENTRY(__retl_o1_asi)
wr %o5, 0x0, %asi
retl
mov %o1, %o0
ENDPROC(__retl_o1_asi)
13 changes: 3 additions & 10 deletions arch/sparc/kernel/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,9 @@ static ssize_t led_proc_write(struct file *file, const char __user *buffer,
if (count > LED_MAX_LENGTH)
count = LED_MAX_LENGTH;

buf = kmalloc(sizeof(char) * (count + 1), GFP_KERNEL);
if (!buf)
return -ENOMEM;

if (copy_from_user(buf, buffer, count)) {
kfree(buf);
return -EFAULT;
}

buf[count] = '\0';
buf = memdup_user_nul(buffer, count);
if (IS_ERR(buf))
return PTR_ERR(buf);

/* work around \n when echo'ing into proc */
if (buf[count - 1] == '\n')
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void __init boot_flags_init(char *commands)
{
while (*commands) {
/* Move to the start of the next "argument". */
while (*commands && *commands == ' ')
while (*commands == ' ')
commands++;

/* Process any command switches, otherwise skip it. */
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void __init boot_flags_init(char *commands)
{
while (*commands) {
/* Move to the start of the next "argument". */
while (*commands && *commands == ' ')
while (*commands == ' ')
commands++;

/* Process any command switches, otherwise skip it. */
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/lib/GENbzero.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
98: x,y; \
.section __ex_table,"a";\
.align 4; \
.word 98b, __retl_o1; \
.word 98b, __retl_o1_asi;\
.text; \
.align 4;

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/lib/NGbzero.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
98: x,y; \
.section __ex_table,"a";\
.align 4; \
.word 98b, __retl_o1; \
.word 98b, __retl_o1_asi;\
.text; \
.align 4;

Expand Down

0 comments on commit 7fc22f4

Please sign in to comment.