lkml.org 
[lkml]   [2021]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] xen: detect uninitialized xenbus in xenbus_init
From
On 18.11.2021 23:24, Boris Ostrovsky wrote:
> On 11/18/21 4:00 PM, Stefano Stabellini wrote:
>>
>> /*
>> * Avoid truncation on 32-bit.
>> * TODO: handle addresses >= 4G
>> */
>> if ( v >= ~0UL ) {
>> err = -EINVAL;
>> goto out_error;
>> }
>
>
> Since this is only relevant to 32-bit kernels then "#if BITS_PER_LONG == 32".

Plus then > instead of >= (thus also making the comment actually decribe
the code) and ULONG_MAX instead of ~0UL, I would say.

Jan

\
 
 \ /
  Last update: 2021-11-19 09:24    [W:0.050 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site