From: Vasant Hegde <vasant.hegde@amd.com>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: iommu@lists.linux.dev, joro@8bytes.org,
suravee.suthikulpanit@amd.com,
Yazen Ghannam <yazen.ghannam@amd.com>
Subject: Re: [PATCH 1/2] iommu/amd: Use BIT/BIT_ULL macro to define bit fields
Date: Wed, 14 Jun 2023 15:15:40 +0530 [thread overview]
Message-ID: <d52a7650-8c14-371c-e88d-d60f391786e4@amd.com> (raw)
In-Reply-To: <otpf4apjgppcdkm7k7jfq36k7l72l4gqm45lrrimza2d46t45e@6wm5d3jmfxu3>
Jerry,
On 6/13/2023 12:25 AM, Jerry Snitselaar wrote:
> On Fri, Jun 09, 2023 at 09:06:30AM +0000, Vasant Hegde wrote:
>> Make use of BIT macro when defining bitfields which makes it easy to read.
>>
>> No functional change intended.
>>
>> Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
>> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
>> ---
>> drivers/iommu/amd/amd_iommu_types.h | 76 ++++++++++++++---------------
>> 1 file changed, 38 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/iommu/amd/amd_iommu_types.h b/drivers/iommu/amd/amd_iommu_types.h
>> index ae0edeb379d4..a49cc2258a76 100644
>> --- a/drivers/iommu/amd/amd_iommu_types.h
>> +++ b/drivers/iommu/amd/amd_iommu_types.h
>> @@ -84,21 +84,21 @@
>>
.../...
>> /*
>> * Bit value definition for DTE fields
>> */
>> -#define DTE_FLAG_V (1ULL << 0)
>> -#define DTE_FLAG_TV (1ULL << 1)
>> -#define DTE_FLAG_IR (1ULL << 61)
>> -#define DTE_FLAG_IW (1ULL << 62)
>> -
>> -#define DTE_FLAG_IOTLB (1ULL << 32)
>> -#define DTE_FLAG_GIOV (1ULL << 54)
>> -#define DTE_FLAG_GV (1ULL << 55)
>> +#define DTE_FLAG_V BIT_ULL(0)
>> +#define DTE_FLAG_TV BIT_ULL(1)
>> +#define DTE_FLAG_IR BIT_ULL(61)
>> +#define DTE_FLAG_IW BIT_ULL(62)
>> +
>> +#define DTE_FLAG_IOTLB BIT_ULL(32)
>> +#define DTE_FLAG_GIOV BIT_ULL(54)
>> +#define DTE_FLAG_GV BIT_ULL(55)
>
> Minor thing, but would it make sense to group these according
> to which 64-bit word they are in? DTE_FLAG_IOTLB is in the
> second 64-bit word of the DTE, and the rest are in the first.
Sure. I will fix it in next version.
-Vasant
next prev parent reply other threads:[~2023-06-14 9:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 9:06 [PATCH 1/2] iommu/amd: Use BIT/BIT_ULL macro to define bit fields Vasant Hegde
2023-06-09 9:06 ` [PATCH 2/2] iommu/amd: Remove extern from function prototypes Vasant Hegde
2023-06-12 18:58 ` Jerry Snitselaar
2023-06-12 18:55 ` [PATCH 1/2] iommu/amd: Use BIT/BIT_ULL macro to define bit fields Jerry Snitselaar
2023-06-14 9:45 ` Vasant Hegde [this message]
2023-06-16 14:34 ` Joerg Roedel
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=d52a7650-8c14-371c-e88d-d60f391786e4@amd.com \
--to=vasant.hegde@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=jsnitsel@redhat.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=yazen.ghannam@amd.com \
/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