lkml.org 
[lkml]   [2021]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][next] xfs: Replace one-element arrays with flexible-array members
From
Date


On 3/9/21 15:26, Darrick J. Wong wrote:
>>> It seems to work all right for casted NULL pointers, and then we get all
>>> the typechecking and multiplication overflow checking, e.g.:
>>>
>>> size_t len64 = struct_size((struct xfs_efi_log_format_32 *)NULL,
>>> efi_extents src_efi_fmt->efi_nextents);
>> Yeah; in that case, what do you think about casting 0, instead of NULL:
>>
>> uint len32 = struct_size((xfs_efi_log_format_32_t *)0, efi_extents,
>> src_efi_fmt->efi_nextents);
>> uint len64 = struct_size((xfs_efi_log_format_64_t *)0, efi_extents,
>> src_efi_fmt->efi_nextents);
> I don't have a preference either way, either here or for the half-dozen
> more of these scattered elsewhere in the file.

OK. I'll send v2, shortly

Thanks for the feedback!
--
Gustavo

\
 
 \ /
  Last update: 2021-03-09 23:30    [W:0.053 / U:1.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site