All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org, Igor Pylypiv <ipylypiv@google.com>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH v2 3/3] ata: libata-sata: Use BIT() macro
Date: Wed, 16 Apr 2025 11:19:10 +0200	[thread overview]
Message-ID: <Z_92DlLnyhCr5MvP@ryzen> (raw)
In-Reply-To: <ed8aca96-896a-48fa-9cf2-b0a50f3e4ef6@kernel.org>

On Wed, Apr 16, 2025 at 05:32:11PM +0900, Damien Le Moal wrote:
> On 4/15/25 4:30 PM, Niklas Cassel wrote:
> > The BIT() macro is commonly used in the kernel.
> > Make use of it when converting a tag, fetched from the Successful NCQ
> > Commands log or the NCQ Command Error log, to a bit field.
> > This makes the code easier to read.
> > 
> > Suggested-by: Igor Pylypiv <ipylypiv@google.com>
> > Signed-off-by: Niklas Cassel <cassel@kernel.org>
> 
> Patch 2 changed sense_valid from u64 to u32. So I think this patch must be
> squashed into patch 2 as otherwise, the first use of sense_valid doing:
> 
> 	if (!(sense_valid & (1ULL << tag))) {
> 
> looks very wrong to me. Even though in practice it is not going to be an issue.

Integer promotion will happen, so it is not a bug, and I change this in patch
3/3 anyway.

But sure, I can send a v3 where I change it to "1 << tag" in patch 2/3,
and then change it to use the BIT() macro in patch 3/3.


Kind regards,
Niklas

      reply	other threads:[~2025-04-16  9:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15  7:30 [PATCH v2 0/3] Successful NCQ commands sense_valid cleanups/fixes Niklas Cassel
2025-04-15  7:30 ` [PATCH v2 1/3] ata: libata-sata: Save all fields from sense data descriptor Niklas Cassel
2025-04-16  8:35   ` Damien Le Moal
2025-04-15  7:30 ` [PATCH v2 2/3] ata: libata-sata: Simplify sense_valid fetching Niklas Cassel
2025-04-15 18:03   ` Igor Pylypiv
2025-04-15  7:30 ` [PATCH v2 3/3] ata: libata-sata: Use BIT() macro Niklas Cassel
2025-04-15  7:47   ` Hannes Reinecke
2025-04-15 18:05   ` Igor Pylypiv
2025-04-16  8:32   ` Damien Le Moal
2025-04-16  9:19     ` Niklas Cassel [this message]

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=Z_92DlLnyhCr5MvP@ryzen \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=ipylypiv@google.com \
    --cc=linux-ide@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.