mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Samuel Holland <samuel.holland@sifive.com>
To: Alexandre Ghiti <alex@ghiti.fr>,
	guoren@kernel.org, tjeznach@rivosinc.com
Cc: joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
	paul.walmsley@sifive.com, palmer@dabbelt.com,
	baolu.lu@linux.intel.com, zong.li@sifive.com,
	iommu@lists.linux.dev, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com>
Subject: Re: [PATCH] iommu/riscv: Fixup compile warning
Date: Mon, 6 Jan 2025 11:47:35 -0600	[thread overview]
Message-ID: <92eb2691-3b40-4549-83cf-fbdd0e98bf63@sifive.com> (raw)
In-Reply-To: <a110be11-923e-4943-8741-43b5513c9691@ghiti.fr>

Hi Alex,

On 2025-01-06 4:31 AM, Alexandre Ghiti wrote:
> On 03/01/2025 03:46, guoren@kernel.org wrote:
>> From: Guo Ren <guoren@linux.alibaba.com>
>>
>> When __BITS_PER_LONG == 32, size_t is defined as unsigned int rather
> 
> 
> RISCV_IOMMU depends on 64BIT so how do you get __BITS_PER_LONG == 32?

I am guessing this is from some downstream effort to compile a 64-bit kernel
with an ILP32 ABI. However unsupported that may be, size_t is the nominal type
used in both riscv_iommu_pte_fetch() and above in iommu_iotlb_gather_add_page(),
so the change does make sense.

Regards,
Samuel

>> than unsigned long. Therefore, we should use size_t to avoid
>> type-checking errors.
>>
>> Fixes: 488ffbf18171 ("iommu/riscv: Paging domain support")
>> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
>> Signed-off-by: Guo Ren <guoren@kernel.org>
>> Cc: Tomasz Jeznach <tjeznach@rivosinc.com>
>> ---
>>   drivers/iommu/riscv/iommu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/riscv/iommu.c b/drivers/iommu/riscv/iommu.c
>> index 8a05def774bd..38d381164385 100644
>> --- a/drivers/iommu/riscv/iommu.c
>> +++ b/drivers/iommu/riscv/iommu.c
>> @@ -1270,7 +1270,7 @@ static phys_addr_t riscv_iommu_iova_to_phys(struct
>> iommu_domain *iommu_domain,
>>                           dma_addr_t iova)
>>   {
>>       struct riscv_iommu_domain *domain = iommu_domain_to_riscv(iommu_domain);
>> -    unsigned long pte_size;
>> +    size_t pte_size;
>>       unsigned long *ptr;
>>         ptr = riscv_iommu_pte_fetch(domain, iova, &pte_size);


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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03  2:46 guoren
2025-01-06 10:31 ` Alexandre Ghiti
2025-01-06 17:47   ` Samuel Holland [this message]
2025-01-08  6:47     ` Guo Ren
2025-01-10 20:48       ` Tomasz Jeznach
2025-01-10  2:44 ` Charlie Jenkins
2025-01-17  7:58 ` Joerg Roedel
2025-02-03 19:16 ` patchwork-bot+linux-riscv

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=92eb2691-3b40-4549-83cf-fbdd0e98bf63@sifive.com \
    --to=samuel.holland@sifive.com \
    --cc=alex@ghiti.fr \
    --cc=baolu.lu@linux.intel.com \
    --cc=guoren@kernel.org \
    --cc=guoren@linux.alibaba.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robin.murphy@arm.com \
    --cc=tjeznach@rivosinc.com \
    --cc=will@kernel.org \
    --cc=zong.li@sifive.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

all inboxes | Powered by JetHome®