Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Eduardo Habkost
On Thu, Jan 18, 2018 at 05:19:56PM -0500, Paolo Bonzini wrote: > > - Eduardo Habkost ha scritto: > > We can do some effort to document the preferred convention to > > return success/failure, but I don't think we will be able to > > convert the existing void/ret/bool functions to a single styl

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Paolo Bonzini
- Eduardo Habkost ha scritto: > We can do some effort to document the preferred convention to > return success/failure, but I don't think we will be able to > convert the existing void/ret/bool functions to a single style > (whatever it is) in a reasonable time. > > That said, IMO returning

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Eduardo Habkost
On Thu, Jan 18, 2018 at 02:34:39PM -0600, Eric Blake wrote: > On 01/18/2018 09:55 AM, Philippe Mathieu-Daudé wrote: > > On Thu, Jan 18, 2018 at 9:03 AM, Paolo Bonzini wrote: > >> On 18/01/2018 12:21, Philippe Mathieu-Daudé wrote: > I'm not a fan of bool return types, in general (because "!" i

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Eric Blake
On 01/18/2018 09:55 AM, Philippe Mathieu-Daudé wrote: > On Thu, Jan 18, 2018 at 9:03 AM, Paolo Bonzini wrote: >> On 18/01/2018 12:21, Philippe Mathieu-Daudé wrote: I'm not a fan of bool return types, in general (because "!" is often success while "< 0" is failure) and especially when the

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Paolo Bonzini
On 18/01/2018 16:55, Philippe Mathieu-Daudé wrote: > On Thu, Jan 18, 2018 at 9:03 AM, Paolo Bonzini wrote: >> On 18/01/2018 12:21, Philippe Mathieu-Daudé wrote: I'm not a fan of bool return types, in general (because "!" is often success while "< 0" is failure) and especially when there

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Philippe Mathieu-Daudé
On Thu, Jan 18, 2018 at 9:03 AM, Paolo Bonzini wrote: > On 18/01/2018 12:21, Philippe Mathieu-Daudé wrote: >>> I'm not a fan of bool return types, in general (because "!" is often >>> success while "< 0" is failure) and especially when there is an Error**; >>> I disagree with commit 9d3b155186. B

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Paolo Bonzini
On 18/01/2018 12:21, Philippe Mathieu-Daudé wrote: >> I'm not a fan of bool return types, in general (because "!" is often >> success while "< 0" is failure) and especially when there is an Error**; >> I disagree with commit 9d3b155186. But the function is not in an area I >> maintain so I'm queui

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Philippe Mathieu-Daudé
On 01/18/2018 05:20 AM, Paolo Bonzini wrote: > On 18/01/2018 03:52, Fam Zheng wrote: >> Coverity doesn't like the ignored return value introduced in >> 9d3b155186c278 (hw/block: Fix the return type), and other callers are >> converted already in ceff3e1f01. >> >> This one was added lately in d9bcd6

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-18 Thread Paolo Bonzini
On 18/01/2018 03:52, Fam Zheng wrote: > Coverity doesn't like the ignored return value introduced in > 9d3b155186c278 (hw/block: Fix the return type), and other callers are > converted already in ceff3e1f01. > > This one was added lately in d9bcd6f7f23a and missed the train. Do it > now. > > Sign

Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-17 Thread Philippe Mathieu-Daudé
On 01/17/2018 11:52 PM, Fam Zheng wrote: > Coverity doesn't like the ignored return value introduced in > 9d3b155186c278 (hw/block: Fix the return type), and other callers are > converted already in ceff3e1f01. > > This one was added lately in d9bcd6f7f23a and missed the train. Do it > now. > > S

[Qemu-devel] [PATCH] scsi-generic: Simplify error handling code

2018-01-17 Thread Fam Zheng
Coverity doesn't like the ignored return value introduced in 9d3b155186c278 (hw/block: Fix the return type), and other callers are converted already in ceff3e1f01. This one was added lately in d9bcd6f7f23a and missed the train. Do it now. Signed-off-by: Fam Zheng --- hw/scsi/scsi-generic.c | 9