public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: ALOK TIWARI <alok.a.tiwari@oracle.com>
To: Simon Horman <horms@kernel.org>
Cc: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com,
	kvm@vger.kernel.org, virtualization@lists.linux.dev,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: Re: [PATCH] vhost: Fix typos in comments and clarity on alignof usage
Date: Wed, 18 Jun 2025 01:31:09 +0530	[thread overview]
Message-ID: <eb95149b-89eb-437f-813d-0045635aee8b@oracle.com> (raw)
In-Reply-To: <20250617183741.GD2545@horms.kernel.org>



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

  reply	other threads:[~2025-06-17 20:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-15 17:39 [PATCH] vhost: Fix typos in comments and clarity on alignof usage Alok Tiwari
2025-06-17 18:37 ` Simon Horman
2025-06-17 20:01   ` ALOK TIWARI [this message]
2025-06-18 12:31     ` Simon Horman
2025-07-16 13:38 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb95149b-89eb-437f-813d-0045635aee8b@oracle.com \
    --to=alok.a.tiwari@oracle.com \
    --cc=eperezma@redhat.com \
    --cc=horms@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox