Re: [Qemu-devel] [PATCH v8 1/4] block: add the block queue support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/17/2011 12:17 PM, Kevin Wolf wrote:
> > >  +
> > >  +static int qemu_block_queue_handler(BlockQueueAIOCB *request)
> > >  +{
> > >  +    int ret;
> > >  +    BlockDriverAIOCB *res;
> > >  +
> > >  +    res = request->handler(request->common.bs, request->sector_num,
> > >  +                           request->qiov, request->nb_sectors,
> > >  +                           qemu_block_queue_callback, request);
> > >  +    if (res) {
> > >  +        request->real_acb = res;
> > >  +    }
> > >  +
> > >  +    ret = (res == NULL) ? 0 : 1;
> > >  +
> > >  +    return ret;
> >
> >  You mean return (res != NULL); and want to have bool as the return value
> >  of this function.
>
>  Yeah, thanks. i will modify as below:
>  ret = (res == NULL) ? false : true;

ret = (res != NULL) is really more readable.

"return (res != NULL);" is even nicer! :)

Paolo

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux