From: Vivek Gautam <vivek.gautam@codeaurora.org>
To: Robin Murphy <robin.murphy@arm.com>,
will.deacon@arm.com, joro@8bytes.org,
iommu@lists.linux-foundation.org
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/1] iommu/io-pgtable: use size_t return type for all foo_unmap
Date: Mon, 5 Feb 2018 23:51:47 +0530 [thread overview]
Message-ID: <42553426-78dd-bd3a-bd73-92a444534fde@codeaurora.org> (raw)
In-Reply-To: <9c91b0a0-3163-09c6-e0d8-6cb69fbf76b3@arm.com>
Hi Robin,
On 2/5/2018 11:38 PM, Robin Murphy wrote:
> On 05/02/18 17:59, Vivek Gautam wrote:
>> Unmap returns a size_t all throughout the IOMMU framework.
>> Make io-pgtable match this convention.
>> Moreover, there isn't a need to have a signed int return type
>> as we return 0 in case of failures.
>
> That makes sense (the code itself has always followed that convention,
> even if the prototypes didn't), and at a glance it looks like you've
> caught all the sites which need it.
Yes, all the foo_unmap() sites.
>
> Acked-by: Robin Murphy <robin.murphy@arm.com>
Thanks Robin
Regards
Vivek
>
>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>> ---
>> drivers/iommu/io-pgtable-arm-v7s.c | 21 +++++++++++----------
>> drivers/iommu/io-pgtable-arm.c | 24 ++++++++++++------------
>> drivers/iommu/io-pgtable.h | 4 ++--
>> 3 files changed, 25 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/iommu/io-pgtable-arm-v7s.c
>> b/drivers/iommu/io-pgtable-arm-v7s.c
>> index 2ca08dc9331c..10e4a3d11c02 100644
>> --- a/drivers/iommu/io-pgtable-arm-v7s.c
>> +++ b/drivers/iommu/io-pgtable-arm-v7s.c
>> @@ -357,8 +357,8 @@ static bool arm_v7s_pte_is_cont(arm_v7s_iopte
>> pte, int lvl)
>> return false;
>> }
>> -static int __arm_v7s_unmap(struct arm_v7s_io_pgtable *, unsigned
>> long,
>> - size_t, int, arm_v7s_iopte *);
>> +static size_t __arm_v7s_unmap(struct arm_v7s_io_pgtable *, unsigned
>> long,
>> + size_t, int, arm_v7s_iopte *);
>> static int arm_v7s_init_pte(struct arm_v7s_io_pgtable *data,
>> unsigned long iova, phys_addr_t paddr, int prot,
>> @@ -541,9 +541,10 @@ static arm_v7s_iopte arm_v7s_split_cont(struct
>> arm_v7s_io_pgtable *data,
>> return pte;
>> }
>> -static int arm_v7s_split_blk_unmap(struct arm_v7s_io_pgtable *data,
>> - unsigned long iova, size_t size,
>> - arm_v7s_iopte blk_pte, arm_v7s_iopte *ptep)
>> +static size_t arm_v7s_split_blk_unmap(struct arm_v7s_io_pgtable *data,
>> + unsigned long iova, size_t size,
>> + arm_v7s_iopte blk_pte,
>> + arm_v7s_iopte *ptep)
>> {
>> struct io_pgtable_cfg *cfg = &data->iop.cfg;
>> arm_v7s_iopte pte, *tablep;
>> @@ -584,9 +585,9 @@ static int arm_v7s_split_blk_unmap(struct
>> arm_v7s_io_pgtable *data,
>> return size;
>> }
>> -static int __arm_v7s_unmap(struct arm_v7s_io_pgtable *data,
>> - unsigned long iova, size_t size, int lvl,
>> - arm_v7s_iopte *ptep)
>> +static size_t __arm_v7s_unmap(struct arm_v7s_io_pgtable *data,
>> + unsigned long iova, size_t size, int lvl,
>> + arm_v7s_iopte *ptep)
>> {
>> arm_v7s_iopte pte[ARM_V7S_CONT_PAGES];
>> struct io_pgtable *iop = &data->iop;
>> @@ -656,8 +657,8 @@ static int __arm_v7s_unmap(struct
>> arm_v7s_io_pgtable *data,
>> return __arm_v7s_unmap(data, iova, size, lvl + 1, ptep);
>> }
>> -static int arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long
>> iova,
>> - size_t size)
>> +static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned
>> long iova,
>> + size_t size)
>> {
>> struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops);
>> diff --git a/drivers/iommu/io-pgtable-arm.c
>> b/drivers/iommu/io-pgtable-arm.c
>> index 51e5c43caed1..8faaaa04d7a7 100644
>> --- a/drivers/iommu/io-pgtable-arm.c
>> +++ b/drivers/iommu/io-pgtable-arm.c
>> @@ -268,9 +268,9 @@ static void __arm_lpae_set_pte(arm_lpae_iopte
>> *ptep, arm_lpae_iopte pte,
>> __arm_lpae_sync_pte(ptep, cfg);
>> }
>> -static int __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
>> - unsigned long iova, size_t size, int lvl,
>> - arm_lpae_iopte *ptep);
>> +static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
>> + unsigned long iova, size_t size, int lvl,
>> + arm_lpae_iopte *ptep);
>> static void __arm_lpae_init_pte(struct arm_lpae_io_pgtable *data,
>> phys_addr_t paddr, arm_lpae_iopte prot,
>> @@ -506,10 +506,10 @@ static void arm_lpae_free_pgtable(struct
>> io_pgtable *iop)
>> kfree(data);
>> }
>> -static int arm_lpae_split_blk_unmap(struct arm_lpae_io_pgtable *data,
>> - unsigned long iova, size_t size,
>> - arm_lpae_iopte blk_pte, int lvl,
>> - arm_lpae_iopte *ptep)
>> +static size_t arm_lpae_split_blk_unmap(struct arm_lpae_io_pgtable
>> *data,
>> + unsigned long iova, size_t size,
>> + arm_lpae_iopte blk_pte, int lvl,
>> + arm_lpae_iopte *ptep)
>> {
>> struct io_pgtable_cfg *cfg = &data->iop.cfg;
>> arm_lpae_iopte pte, *tablep;
>> @@ -560,9 +560,9 @@ static int arm_lpae_split_blk_unmap(struct
>> arm_lpae_io_pgtable *data,
>> return size;
>> }
>> -static int __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
>> - unsigned long iova, size_t size, int lvl,
>> - arm_lpae_iopte *ptep)
>> +static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
>> + unsigned long iova, size_t size, int lvl,
>> + arm_lpae_iopte *ptep)
>> {
>> arm_lpae_iopte pte;
>> struct io_pgtable *iop = &data->iop;
>> @@ -606,8 +606,8 @@ static int __arm_lpae_unmap(struct
>> arm_lpae_io_pgtable *data,
>> return __arm_lpae_unmap(data, iova, size, lvl + 1, ptep);
>> }
>> -static int arm_lpae_unmap(struct io_pgtable_ops *ops, unsigned
>> long iova,
>> - size_t size)
>> +static size_t arm_lpae_unmap(struct io_pgtable_ops *ops, unsigned
>> long iova,
>> + size_t size)
>> {
>> struct arm_lpae_io_pgtable *data = io_pgtable_ops_to_data(ops);
>> arm_lpae_iopte *ptep = data->pgd;
>> diff --git a/drivers/iommu/io-pgtable.h b/drivers/iommu/io-pgtable.h
>> index cd2e1eafffe6..2df79093cad9 100644
>> --- a/drivers/iommu/io-pgtable.h
>> +++ b/drivers/iommu/io-pgtable.h
>> @@ -119,8 +119,8 @@ struct io_pgtable_cfg {
>> struct io_pgtable_ops {
>> int (*map)(struct io_pgtable_ops *ops, unsigned long iova,
>> phys_addr_t paddr, size_t size, int prot);
>> - int (*unmap)(struct io_pgtable_ops *ops, unsigned long iova,
>> - size_t size);
>> + size_t (*unmap)(struct io_pgtable_ops *ops, unsigned long iova,
>> + size_t size);
>> phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,
>> unsigned long iova);
>> };
>>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-02-05 18:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 17:59 Vivek Gautam
2018-02-05 18:08 ` Robin Murphy
2018-02-05 18:21 ` Vivek Gautam [this message]
2018-02-13 18:33 ` 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=42553426-78dd-bd3a-bd73-92a444534fde@codeaurora.org \
--to=vivek.gautam@codeaurora.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will.deacon@arm.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
Powered by JetHome