[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <158689344462.84447.17260207632295085186@swboyd.mtv.corp.google.com>
Date: Tue, 14 Apr 2020 12:44:04 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Douglas Anderson <dianders@...omium.org>
Cc: mkshah@...eaurora.org, mka@...omium.org, joe@...ches.com,
evgreen@...omium.org, Douglas Anderson <dianders@...omium.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Factor "tcs_reg_addr" and "tcs_cmd_addr" calculation
Quoting Douglas Anderson (2020-04-14 10:41:34)
> We can make some of the register access functions more readable by
> factoring out the calculations a little bit.
>
> Suggested-by: Joe Perches <joe@...ches.com>
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> ---
>
> drivers/soc/qcom/rpmh-rsc.c | 27 ++++++++++++++++++---------
> 1 file changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index 732316bb67dc..de1f9c7732e1 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -136,36 +136,45 @@
> * +---------------------------------------------------+
> */
>
> +static inline void __iomem *
> +tcs_reg_addr(struct rsc_drv *drv, int reg, int tcs_id)
const drv?
> +{
> + return drv->tcs_base + RSC_DRV_TCS_OFFSET * tcs_id + reg;
> +}
> +
> +static inline void __iomem *
> +tcs_cmd_addr(struct rsc_drv *drv, int reg, int tcs_id, int cmd_id)
const drv?
> +{
> + return tcs_reg_addr(drv, reg, tcs_id) + RSC_DRV_CMD_OFFSET * cmd_id;
> +}
> +
Powered by blists - more mailing lists