Re: [PATCH v2 3/3] ata: libata-sata: Use BIT() macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> > Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx>
> 
> 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




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux