lkml.org 
[lkml]   [2021]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 3/6] futex: Get rid of the val2 conditional dance
Date
On Fri, Apr 23 2021 at 18:40, André Almeida wrote:
>>
>> - return do_futex(uaddr, op, val, tp, uaddr2, val2, val3);
>> + return do_futex(uaddr, op, val, tp, uaddr2, (unsigned long)utime, val3);
>
> Given do_futex()'s type signature, I think it makes more sense to cast
> utime to u32.

It's a pointer which you better force cast to unsigned long first.

So the explicit thing would be '(u32)(unsigned long) utime' which is
what the val2 dance stupidly did with 'int'

val2 = (int) (unsigned long) utime;

But with doing it at function call argument it's implicit, because the

unsigned long to u32 conversion is well defined

while

(u32)ptr

is only well defined on 32bit.

Thanks,

tglx

\
 
 \ /
  Last update: 2021-04-24 00:35    [W:0.599 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site