Skip to contentSkip to conversation

staging: atomisp: remove unnecessary else after return in atomisp_cmd.c

PATCH Superseded Oskar Ray-Frayssinet 2 participants 2 messages Mar 1

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: atomisp: remove unnecessary else after return in atomisp_cmd.c

Remove unnecessary else clause after return statement as the else branch is not needed when the if branch alsways returns.

---
 drivers/staging/media/atomisp/pci/atomisp_cmd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_cmd.c +1 -2
index 9d22ec27ea76..d5c5895e06e2 100644
@@ -2035,8 +2035,7 @@ static unsigned int long copy_from_compatible(void *to, const void *from,
 {
 	if (from_user)
 		return copy_from_user(to, (void __user *)from, n);
-	else
-		memcpy(to, from, n);
+	memcpy(to, from, n);
 	return 0;
 }
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 2 lines · Oskar Ray-Frayssinet

Remove unnecessary else clause after return statement as the else branch is not needed when the if branch alsways returns.

Typo alsways.

Quoted 3 lines

---

...

drivers/staging/media/atomisp/pci/atomisp_cmd.c static unsigned int long copy_from_compatible(void *to, const void *from, · line 2039

Quoted 4 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.c +0 -2
 	if (from_user)
 		return copy_from_user(to, (void __user *)from, n);
-	else
-		memcpy(to, from, n);

Put blank line here.

drivers/staging/media/atomisp/pci/atomisp_cmd.c static unsigned int long copy_from_compatible(void *to, const void *from, · line 2040

Quoted 4 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.c +1 -0
+	memcpy(to, from, n);
 	return 0;
 }

Also from what I can tell your sending a few patches affecting the same driver, typically you'd make it a patch series with a cover letter.

Thanks,

ET