On 5. Mar 2025, at 12:02, Ingo Molnar wrote:
> * Thorsten Blum wrote:
>> On 5. Mar 2025, at 10:18, Ingo Molnar wrote:
>>> Actually, on a second thought:
>>>
- buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL,
node);
+ buf = kzalloc_node(struct_size(buf, buf, n
* Thorsten Blum wrote:
> On 5. Mar 2025, at 10:18, Ingo Molnar wrote:
> > Actually, on a second thought:
> >
> >> - buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL,
> >> node);
> >> + buf = kzalloc_node(struct_size(buf, buf, nbuf), GFP_KERNEL, node);
> >
> > Firstly, in
On 5. Mar 2025, at 10:18, Ingo Molnar wrote:
> Actually, on a second thought:
>
>> - buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL,
>> node);
>> + buf = kzalloc_node(struct_size(buf, buf, nbuf), GFP_KERNEL, node);
>
> Firstly, in what world is 'buf, buf' more readable? On