drivers: fsi: scom: Fix return code for putscom
PATCH 1/1 drivers: fsi: scom: Fix return code for putscom
From: "Edward A. James" <[email protected]>
Read/write calls should return the number of bytes read/written on success.
--- drivers/fsi/fsi-scom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-scom.c +1 -1
@@ -156,7 +156,7 @@ static ssize_t scom_write(struct file *filep, const char __user *buf,if (rc)dev_dbg (dev,"put_scom failed with:%d\n" , rc); -return rc; +return rc ? rc : len; }static loff_t scom_llseek (struct file *file,loff_t offset,int whence)
Signature · 1 line
1.8.3.1
Quoted 15 lines · Eddie James
From: "Edward A. James" <[email protected]>
Read/write calls should return the number of bytes read/written on success.
Signed-off-by Edward A. James <[email protected]>--- drivers/fsi/fsi-scom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fsi/fsi-scom.c +0
-0
drivers/fsi/fsi-scom.c static ssize_t scom_write(struct file *filep, const char __user *buf, · line 159
Quoted 5 lines
drivers/fsi/fsi-scom.c +1
-1@@ -156,7 +156,7 @@ static ssize_t scom_write(struct file *filep, const char __user *buf,if (rc)dev_dbg (dev,"put_scom failed with:%d\n" , rc); -return rc; +return rc ? rc : len;
I refactored this to be:
if (rc) {
dev_dbg(dev, "put_scom failed with:%d\n", rc);
return rc;}
return len;
Are you ok with that?
Quoted 6 lines
drivers/fsi/fsi-scom.c +0
-1}static loff_t scom_llseek (struct file *file,loff_t offset,int whence) --1.8.3.1
Yes, looks good, thanks!
Quoted 40 lines · Joel Stanley
Quoted 15 lines · Eddie James
From: "Edward A. James" <[email protected]>
Read/write calls should return the number of bytes read/written on success.
Signed-off-by Edward A. James <[email protected]>--- drivers/fsi/fsi-scom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fsi/fsi-scom.c +0
-0drivers/fsi/fsi-scom.c static ssize_t scom_write(struct file *filep, const char __user *buf, · line 159
Quoted 5 lines
drivers/fsi/fsi-scom.c +1
-1@@ -156,7 +156,7 @@ static ssize_t scom_write(struct file *filep, const char __user *buf,if (rc)dev_dbg (dev,"put_scom failed with:%d\n" , rc); -return rc; +return rc ? rc : len;I refactored this to be:
if (rc) { dev_dbg(dev, "put_scom failed with:%d\n", rc); return rc;}
return len;
Are you ok with that?
Quoted 6 lines
drivers/fsi/fsi-scom.c +0
-1}static loff_t scom_llseek (struct file *file,loff_t offset,int whence) --1.8.3.1
Quoted 1 line · Eddie James
Yes, looks good, thanks!
Cool, I applied it to dev-4.7.
Cheers,
Joel
Quoted 42 lines · Joel Stanley
Quoted 40 lines · Eddie James
Quoted 15 lines
From: "Edward A. James" <[email protected]>
Read/write calls should return the number of bytes read/written on success.
Signed-off-by Edward A. James <[email protected]>--- drivers/fsi/fsi-scom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/fsi/fsi-scom.c +0
-0drivers/fsi/fsi-scom.c static ssize_t scom_write(struct file *filep, const char __user *buf, · line 159
Quoted 5 lines
drivers/fsi/fsi-scom.c +1
-1@@ -156,7 +156,7 @@ static ssize_t scom_write(struct file *filep, const char __user *buf,if (rc)dev_dbg (dev,"put_scom failed with:%d\n" , rc); -return rc; +return rc ? rc : len;I refactored this to be:
if (rc) { dev_dbg(dev, "put_scom failed with:%d\n", rc); return rc;}
return len;
Are you ok with that?
Quoted 6 lines
drivers/fsi/fsi-scom.c +0
-1}static loff_t scom_llseek (struct file *file,loff_t offset,int whence) --1.8.3.1