linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jaehoon Chung <jh80.chung@samsung.com>
Cc: linux-pci@vger.kernel.org, helgaas@google.com, krzk@kernel.org,
	linux-kernel@vger.kernel.org, jingoohan1@gmail.com,
	javier@osg.samsung.com, kgene@kernel.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH 1/4] PCI: exynos: replace to one register accessor from each accessors
Date: Wed, 11 Jan 2017 12:50:03 -0600	[thread overview]
Message-ID: <20170111185003.GG14532@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20161219081614.5403-2-jh80.chung@samsung.com>

Hi Jaehoon,

On Mon, Dec 19, 2016 at 05:16:11PM +0900, Jaehoon Chung wrote:
> There is no reason to maintain *_blk/phy/elbi_* as register accessors.
> It can be replaced to one register accessor.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  drivers/pci/host/pci-exynos.c | 214 +++++++++++++++++++-----------------------
>  1 file changed, 97 insertions(+), 117 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
> index f1c544b..6dbfa2c 100644
> --- a/drivers/pci/host/pci-exynos.c
> +++ b/drivers/pci/host/pci-exynos.c
> @@ -102,197 +102,175 @@ struct exynos_pcie {
>  #define PCIE_PHY_TRSV3_PD_TSV		(0x1 << 7)
>  #define PCIE_PHY_TRSV3_LVCC		0x31c
>  
> -static void exynos_elb_writel(struct exynos_pcie *exynos_pcie, u32 val, u32 reg)
> +static void exynos_pcie_writel(void __iomem *base, u32 val, u32 reg)
>  {
> -	writel(val, exynos_pcie->elbi_base + reg);
> +	writel(val, base + reg);
>  }
>  
> -static u32 exynos_elb_readl(struct exynos_pcie *exynos_pcie, u32 reg)
> +static u32 exynos_pcie_readl(void __iomem *base, u32 reg)
>  {
> -	return readl(exynos_pcie->elbi_base + reg);
> +	return readl(base + reg);
>  }
>  
> -static void exynos_phy_writel(struct exynos_pcie *exynos_pcie, u32 val, u32 reg)
> -{
> -	writel(val, exynos_pcie->phy_base + reg);
> -}
> -
> -static u32 exynos_phy_readl(struct exynos_pcie *exynos_pcie, u32 reg)
> -{
> -	return readl(exynos_pcie->phy_base + reg);
> -}
> -
> -static void exynos_blk_writel(struct exynos_pcie *exynos_pcie, u32 val, u32 reg)
> -{
> -	writel(val, exynos_pcie->block_base + reg);
> -}
> -
> -static u32 exynos_blk_readl(struct exynos_pcie *exynos_pcie, u32 reg)
> -{
> -	return readl(exynos_pcie->block_base + reg);
> -}
> -
> -static void exynos_pcie_sideband_dbi_w_mode(struct exynos_pcie *exynos_pcie,
> -					    bool on)
> +static void exynos_pcie_sideband_dbi_w_mode(struct exynos_pcie *ep, bool on)

Replacing all the separate accessors with one that takes the base
pointer is OK, but please use the same name for all the "struct
exynos_pcie *" pointers in the whole file.

Before your patch, they were all called "exynos_pci"; after it some
are called "exynos_pci" and some are called "ep".

Bjorn

  reply	other threads:[~2017-01-11 18:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19  8:16 [PATCH 0/4] PCI: exynos: cleans the minor things Jaehoon Chung
2016-12-19  8:16 ` [PATCH 1/4] PCI: exynos: replace to one register accessor from each accessors Jaehoon Chung
2017-01-11 18:50   ` Bjorn Helgaas [this message]
2017-01-12  1:13     ` Jaehoon Chung
2016-12-19  8:16 ` [PATCH 2/4] PCI: exynos: Remove the unnecessary variables Jaehoon Chung
2016-12-19  8:16 ` [PATCH 3/4] PCI: exynos: Use the bitops API to operate the bit shifting Jaehoon Chung
2016-12-19  8:16 ` [PATCH 4/4] PCI: exynos: remove the duplicated codes Jaehoon Chung
2016-12-20 17:35 ` [PATCH 0/4] PCI: exynos: cleans the minor things Bartlomiej Zolnierkiewicz
2016-12-26 13:52   ` Jingoo Han
2016-12-19  8:17 Jaehoon Chung
2016-12-19  8:17 ` [PATCH 1/4] PCI: exynos: replace to one register accessor from each accessors Jaehoon Chung
2016-12-24  9:27   ` Krzysztof Kozlowski

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=20170111185003.GG14532@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=helgaas@google.com \
    --cc=javier@osg.samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=jingoohan1@gmail.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --subject='Re: [PATCH 1/4] PCI: exynos: replace to one register accessor from each accessors' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).