Re: [PATCH libdrm] xf86drm.c: Use integer logarithm.

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

 



On 10/28/20 13:30, Michel Dänzer wrote:
> On 2020-10-28 11:09 a.m., Paul Gofman wrote:
>> On 10/28/20 11:18, Pekka Paalanen wrote:
>>>
>>>>   +static unsigned log2_int(unsigned x)
>>>> +{
>>>> +    unsigned l;
>>>> +
>>>> +    if (x < 2) {
>>>> +        return 0;
>>>> +    }
>>>> +    for (l = 2; ; l++) {
>>>> +        if ((unsigned)(1 << l) > x) {
>>> Hi,
>>>
>>> wouldn't this loop fail to end when x >= 0x80000000?
>>>
>>> Sure, such value probably cannot occur where this is currently used,
>>> but it seems like a landmine for the next developer to step on.
>>>
>> Indeed, thanks. I've sent the patches for consideration which avoid
>> function duplication and potentially infinite loop.
>
> libdrm uses GitLab merge requests now:
> https://gitlab.freedesktop.org/mesa/drm/-/merge_requests
>
>
I see, thanks. I was following the instructions in CONTRIBUTING.rst.

Do you think I should proceed with merge request for these patches or
those already sent could be considered this way?

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux