All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wladimir J. van der Laan" <laanwj@gmail.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	patchwork-lst@pengutronix.de, kernel@pengutronix.de,
	Russell King <linux+etnaviv@armlinux.org.uk>
Subject: Re: [PATCH 5/8] etnaviv: iommuv1: fold pgtable_write into callers
Date: Wed, 27 Sep 2017 13:30:52 +0200	[thread overview]
Message-ID: <20170927113052.GE7198@amethyst.visucore.com> (raw)
In-Reply-To: <20170915170439.9768-5-l.stach@pengutronix.de>

On Fri, Sep 15, 2017 at 07:04:36PM +0200, Lucas Stach wrote:
> A function doing a single assignment is not really helping the
> code flow.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

agreed.

Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_iommu.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c
> index 78a7c0f3064a..43a0508bdbd7 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c
> @@ -49,15 +49,6 @@ static struct etnaviv_iommu_domain *to_etnaviv_domain(struct iommu_domain *domai
>  	return container_of(domain, struct etnaviv_iommu_domain, domain);
>  }
>  
> -static void pgtable_write(struct etnaviv_iommu_domain_pgtable *pgtable,
> -			  unsigned long iova, phys_addr_t paddr)
> -{
> -	/* calcuate index into page table */
> -	unsigned int index = (iova - GPU_MEM_START) / SZ_4K;
> -
> -	pgtable->pgtable[index] = paddr;
> -}
> -
>  static int __etnaviv_iommu_init(struct etnaviv_iommu_domain *etnaviv_domain)
>  {
>  	u32 *p;
> @@ -111,11 +102,12 @@ static int etnaviv_iommuv1_map(struct iommu_domain *domain, unsigned long iova,
>  	   phys_addr_t paddr, size_t size, int prot)
>  {
>  	struct etnaviv_iommu_domain *etnaviv_domain = to_etnaviv_domain(domain);
> +	unsigned int index = (iova - GPU_MEM_START) / SZ_4K;
>  
>  	if (size != SZ_4K)
>  		return -EINVAL;
>  
> -	pgtable_write(&etnaviv_domain->pgtable, iova, paddr);
> +	etnaviv_domain->pgtable.pgtable[index] = paddr;
>  
>  	return 0;
>  }
> @@ -124,12 +116,12 @@ static size_t etnaviv_iommuv1_unmap(struct iommu_domain *domain,
>  	unsigned long iova, size_t size)
>  {
>  	struct etnaviv_iommu_domain *etnaviv_domain = to_etnaviv_domain(domain);
> +	unsigned int index = (iova - GPU_MEM_START) / SZ_4K;
>  
>  	if (size != SZ_4K)
>  		return -EINVAL;
>  
> -	pgtable_write(&etnaviv_domain->pgtable, iova,
> -		      etnaviv_domain->bad_page_dma);
> +	etnaviv_domain->pgtable.pgtable[index] = etnaviv_domain->bad_page_dma;
>  
>  	return SZ_4K;
>  }
> -- 
> 2.11.0
> 
> _______________________________________________
> etnaviv mailing list
> etnaviv@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-09-27 11:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 17:04 [PATCH 1/8] etnaviv: remove iommu fault handler Lucas Stach
2017-09-15 17:04 ` [PATCH 2/8] etnaviv: remove iova_to_phys iommu ops Lucas Stach
2017-09-18 18:40   ` Philipp Zabel
2017-09-27 11:24   ` Wladimir J. van der Laan
2017-09-15 17:04 ` [PATCH 3/8] etnaviv: iommuv1: fold pagetable alloc and free into caller Lucas Stach
2017-09-18 18:41   ` Philipp Zabel
2017-09-27 11:26   ` Wladimir J. van der Laan
2017-09-15 17:04 ` [PATCH 4/8] etnaviv: iommuv1: remove map_lock Lucas Stach
2017-09-18 18:41   ` Philipp Zabel
2017-09-27 11:28   ` Wladimir J. van der Laan
2017-09-15 17:04 ` [PATCH 5/8] etnaviv: iommuv1: fold pgtable_write into callers Lucas Stach
2017-09-18 18:42   ` Philipp Zabel
2017-09-27 11:30   ` Wladimir J. van der Laan [this message]
2017-09-15 17:04 ` [PATCH 6/8] etnaviv: mmu: stop using iommu map/unmap functions Lucas Stach
2017-09-18 18:35   ` Philipp Zabel
2017-09-27 11:36   ` Wladimir J. van der Laan
2017-09-15 17:04 ` [PATCH 7/8] etnaviv: mmu: mark local functions static Lucas Stach
2017-09-18 18:42   ` Philipp Zabel
2017-09-27 11:37   ` Wladimir J. van der Laan
2017-09-15 17:04 ` [PATCH 8/8] etnaviv: remove IOMMU dependency Lucas Stach
2017-09-18 18:33   ` Philipp Zabel
2017-09-27 11:39   ` Wladimir J. van der Laan
2017-09-18 18:40 ` [PATCH 1/8] etnaviv: remove iommu fault handler Philipp Zabel
2017-09-27 11:24 ` Wladimir J. van der Laan

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=20170927113052.GE7198@amethyst.visucore.com \
    --to=laanwj@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux+etnaviv@armlinux.org.uk \
    --cc=patchwork-lst@pengutronix.de \
    /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.