lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eb95149b-89eb-437f-813d-0045635aee8b@oracle.com>
Date: Wed, 18 Jun 2025 01:31:09 +0530
From: ALOK TIWARI <alok.a.tiwari@...cle.com>
To: Simon Horman <horms@...nel.org>
Cc: mst@...hat.com, jasowang@...hat.com, eperezma@...hat.com,
        kvm@...r.kernel.org, virtualization@...ts.linux.dev,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: Re: [PATCH] vhost: Fix typos in comments and clarity on alignof
 usage



Thanks Simon,

On 6/18/2025 12:07 AM, Simon Horman wrote:
> On Sun, Jun 15, 2025 at 10:39:11AM -0700, Alok Tiwari wrote:
>> This patch fixes multiple typos and improves comment clarity across
>> vhost.c.
>> - Correct spelling errors: "thead" -> "thread", "RUNNUNG" -> "RUNNING"
>>    and "available".
>> - Improve comment by replacing informal comment ("Supersize me!")
>>    with a clear description.
>> - Use __alignof__ correctly on dereferenced pointer types for better
>>    readability and alignment with kernel documentation.
> Could you expand on the last point?
> I see that the patch uses __alignof__ with rather than without parentheses.
> But I don't follow how that corresponds with the comment above.

only I can say "__alignof__ *vq->avail" is valid C,
but it can hard to read and easy to misinterpret.
Without proper parentheses sometime, __alignof__ *vq->avail can be 
misleading to reader. it may not be immediately clear whether it refers 
to alignment of the pointer vq->avail or
alignment of the object it points to.
__alignof__(*vq->avail) adds parentheses that clarify the intention 
explicitly.
I can not see very clear guide line to using parentheses or not for 
__alignof__ in kernel document apart 
from(https://www.kernel.org/doc/html/latest/process/coding-style.html).
Additionally, I have not been able to locate examples in the kernel code 
where __alignof__ is used without parentheses.


Thanks,
Alok

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ