* [PATCH linux dev-4.7] drivers: fsi: scom: Fix return code for putscom
@ 2017-02-20 21:17 Eddie James
2017-02-20 23:39 ` Joel Stanley
0 siblings, 1 reply; 4+ messages in thread
From: Eddie James @ 2017-02-20 21:17 UTC (permalink / raw)
To: openbmc; +Cc: joel, cbostic, Edward A. James
From: "Edward A. James" <eajames@us.ibm.com>
Read/write calls should return the number of bytes read/written on
success.
Signed-off-by: Edward A. James <eajames@us.ibm.com>
---
drivers/fsi/fsi-scom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index 2874ea0..51b3dc3 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH linux dev-4.7] drivers: fsi: scom: Fix return code for putscom
2017-02-20 21:17 [PATCH linux dev-4.7] drivers: fsi: scom: Fix return code for putscom Eddie James
@ 2017-02-20 23:39 ` Joel Stanley
2017-02-21 4:14 ` Eddie James
0 siblings, 1 reply; 4+ messages in thread
From: Joel Stanley @ 2017-02-20 23:39 UTC (permalink / raw)
To: Eddie James; +Cc: OpenBMC Maillist, Christopher Bostic, Edward A. James
On Tue, Feb 21, 2017 at 7:47 AM, Eddie James <eajames@linux.vnet.ibm.com> wrote:
> From: "Edward A. James" <eajames@us.ibm.com>
>
> Read/write calls should return the number of bytes read/written on
> success.
>
> Signed-off-by: Edward A. James <eajames@us.ibm.com>
> ---
> drivers/fsi/fsi-scom.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
> index 2874ea0..51b3dc3 100644
> --- a/drivers/fsi/fsi-scom.c
> +++ b/drivers/fsi/fsi-scom.c
> @@ -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?
> }
>
> static loff_t scom_llseek(struct file *file, loff_t offset, int whence)
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH linux dev-4.7] drivers: fsi: scom: Fix return code for putscom
2017-02-20 23:39 ` Joel Stanley
@ 2017-02-21 4:14 ` Eddie James
2017-02-21 4:15 ` Joel Stanley
0 siblings, 1 reply; 4+ messages in thread
From: Eddie James @ 2017-02-21 4:14 UTC (permalink / raw)
To: Joel Stanley
Cc: Eddie James, Edward A. James, OpenBMC Maillist, Christopher Bostic
Yes, looks good, thanks!
On Mon, Feb 20, 2017 at 5:39 PM, Joel Stanley <joel@jms.id.au> wrote:
> On Tue, Feb 21, 2017 at 7:47 AM, Eddie James <eajames@linux.vnet.ibm.com> wrote:
>> From: "Edward A. James" <eajames@us.ibm.com>
>>
>> Read/write calls should return the number of bytes read/written on
>> success.
>>
>> Signed-off-by: Edward A. James <eajames@us.ibm.com>
>> ---
>> drivers/fsi/fsi-scom.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
>> index 2874ea0..51b3dc3 100644
>> --- a/drivers/fsi/fsi-scom.c
>> +++ b/drivers/fsi/fsi-scom.c
>> @@ -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?
>
>
>> }
>>
>> static loff_t scom_llseek(struct file *file, loff_t offset, int whence)
>> --
>> 1.8.3.1
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH linux dev-4.7] drivers: fsi: scom: Fix return code for putscom
2017-02-21 4:14 ` Eddie James
@ 2017-02-21 4:15 ` Joel Stanley
0 siblings, 0 replies; 4+ messages in thread
From: Joel Stanley @ 2017-02-21 4:15 UTC (permalink / raw)
To: Eddie James
Cc: Eddie James, Edward A. James, OpenBMC Maillist, Christopher Bostic
On Tue, Feb 21, 2017 at 2:44 PM, Eddie James <eajames.ibm@gmail.com> wrote:
> Yes, looks good, thanks!
Cool, I applied it to dev-4.7.
Cheers,
Joel
>
> On Mon, Feb 20, 2017 at 5:39 PM, Joel Stanley <joel@jms.id.au> wrote:
>> On Tue, Feb 21, 2017 at 7:47 AM, Eddie James <eajames@linux.vnet.ibm.com> wrote:
>>> From: "Edward A. James" <eajames@us.ibm.com>
>>>
>>> Read/write calls should return the number of bytes read/written on
>>> success.
>>>
>>> Signed-off-by: Edward A. James <eajames@us.ibm.com>
>>> ---
>>> drivers/fsi/fsi-scom.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
>>> index 2874ea0..51b3dc3 100644
>>> --- a/drivers/fsi/fsi-scom.c
>>> +++ b/drivers/fsi/fsi-scom.c
>>> @@ -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?
>>
>>
>>> }
>>>
>>> static loff_t scom_llseek(struct file *file, loff_t offset, int whence)
>>> --
>>> 1.8.3.1
>>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-21 4:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 21:17 [PATCH linux dev-4.7] drivers: fsi: scom: Fix return code for putscom Eddie James
2017-02-20 23:39 ` Joel Stanley
2017-02-21 4:14 ` Eddie James
2017-02-21 4:15 ` Joel Stanley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.