All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Vinod Koul <vkoul@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Swapnil Jakhade <sjakhade@cadence.com>,
	Yuti Amonkar <yamonkar@cadence.com>,
	Sanket Parmar <sparmar@cadence.com>
Subject: RE: [PATCH 2/3] phy: cadence: salvo: Constify cdns_nxp_sequence_pair
Date: Sun, 13 Sep 2020 05:12:52 +0000	[thread overview]
Message-ID: <AM7PR04MB7157E52665722D732A4581808B220@AM7PR04MB7157.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200912204639.501669-3-rikard.falkeborn@gmail.com>

 
> 
> cdns_nxp_sequence_pair[] are never modified and can be made const to allow
> the compiler to put them in read-only memory.
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Peter Chen <peter.chen@nxp.com>

Peter
> ---
>  drivers/phy/cadence/phy-cadence-salvo.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/cadence/phy-cadence-salvo.c
> b/drivers/phy/cadence/phy-cadence-salvo.c
> index 8c33d3215f2d..88e239adc3b8 100644
> --- a/drivers/phy/cadence/phy-cadence-salvo.c
> +++ b/drivers/phy/cadence/phy-cadence-salvo.c
> @@ -97,7 +97,7 @@ struct cdns_reg_pairs {
> 
>  struct cdns_salvo_data {
>  	u8 reg_offset_shift;
> -	struct cdns_reg_pairs *init_sequence_val;
> +	const struct cdns_reg_pairs *init_sequence_val;
>  	u8 init_sequence_length;
>  };
> 
> @@ -126,7 +126,7 @@ static void cdns_salvo_write(struct cdns_salvo_phy
> *salvo_phy,
>   * Below bringup sequence pair are from Cadence PHY's User Guide
>   * and NXP platform tuning results.
>   */
> -static struct cdns_reg_pairs cdns_nxp_sequence_pair[] = {
> +static const struct cdns_reg_pairs cdns_nxp_sequence_pair[] = {
>  	{0x0830, PHY_PMA_CMN_CTRL1},
>  	{0x0010, TB_ADDR_CMN_DIAG_HSCLK_SEL},
>  	{0x00f0, TB_ADDR_CMN_PLL0_VCOCAL_INIT_TMR},
> @@ -217,7 +217,7 @@ static int cdns_salvo_phy_init(struct phy *phy)
>  		return ret;
> 
>  	for (i = 0; i < data->init_sequence_length; i++) {
> -		struct cdns_reg_pairs *reg_pair = data->init_sequence_val + i;
> +		const struct cdns_reg_pairs *reg_pair = data->init_sequence_val + i;
> 
>  		cdns_salvo_write(salvo_phy, reg_pair->off, reg_pair->val);
>  	}
> --
> 2.28.0


  reply	other threads:[~2020-09-13  5:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12 20:46 [PATCH 0/3] drivers/phy/cadence: Constify static structs Rikard Falkeborn
2020-09-12 20:46 ` [PATCH 1/3] phy: cadence: Sierra: " Rikard Falkeborn
2020-09-12 20:46 ` [PATCH 2/3] phy: cadence: salvo: Constify cdns_nxp_sequence_pair Rikard Falkeborn
2020-09-13  5:12   ` Peter Chen [this message]
2020-09-12 20:46 ` [PATCH 3/3] phy: cadence: torrent: Constify regmap_config structs Rikard Falkeborn
2020-09-16 12:13 ` [PATCH 0/3] drivers/phy/cadence: Constify static structs Vinod Koul

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=AM7PR04MB7157E52665722D732A4581808B220@AM7PR04MB7157.eurprd04.prod.outlook.com \
    --to=peter.chen@nxp.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rikard.falkeborn@gmail.com \
    --cc=sjakhade@cadence.com \
    --cc=sparmar@cadence.com \
    --cc=vkoul@kernel.org \
    --cc=yamonkar@cadence.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 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.