[Openchrome-devel] openchrome bug
Thomas Hellström
thomas
Mon Jan 19 00:30:43 PST 2009
Jon Nettleton wrote:
> On Wed, Jan 14, 2009 at 7:19 PM, Bartosz Kosiorek <gang65 at poczta.onet.pl> wrote:
>
>> Hi.
>> I found bug in libxvmc/viaLowLevel.c
>> The function always return 0, even if drmCommandWriteRead was failed.
>> I think it should be:
>>
>> - if (drmCommandWriteRead(xl->fd, DRM_VIA_ALLOCMEM, &xl->tsMem,
>> - sizeof(xl->tsMem)) < 0)
>> + if ((ret = drmCommandWriteRead(xl->fd, DRM_VIA_ALLOCMEM, &xl->tsMem,
>> + sizeof(xl->tsMem))) < 0)
>> return ret;
>>
>> I also use common code convention for "drmCommandRead",
>> "drmCommandWriteRead" and "drmCommandWrite", to avoid mistakes.
>>
>> The return values of the functions: "drmCommandRead",
>> "drmCommandWriteRead" and "drmCommandWrite" should be zero on
>> success, or a negative values on failure.
>>
>>
>
> Bartosz,
>
> Thanks for your time and effort. I have checked in the parts of the
> patch that would functionally change the way the code works. I have
> not checked in syntax of the logic changes that you submitted because
> it would break code uniformity with most of the xorg drivers that
> exist.
>
> Could someone else on the list that has more history with xorg give us
> some understanding why when checking the ret of drmCommand functions
> we use this?
>
> - if (ret) {
>
> instead of
>
> + if (ret < 0) {
>
>
> If there is a reason other than personal preference to change this I
> will. My take is to stick with the rest of the community on this one.
>
> Jon
>
>
Jon,
There is no particular reason. Any of the above forms should do.
Thomas
More information about the Openchrome-devel
mailing list