[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM7PR04MB7157E52665722D732A4581808B220@AM7PR04MB7157.eurprd04.prod.outlook.com>
Date: Sun, 13 Sep 2020 05:12:52 +0000
From: Peter Chen <peter.chen@....com>
To: Rikard Falkeborn <rikard.falkeborn@...il.com>,
Kishon Vijay Abraham I <kishon@...com>,
Vinod Koul <vkoul@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Swapnil Jakhade <sjakhade@...ence.com>,
Yuti Amonkar <yamonkar@...ence.com>,
Sanket Parmar <sparmar@...ence.com>
Subject: RE: [PATCH 2/3] phy: cadence: salvo: Constify cdns_nxp_sequence_pair
>
> 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@...il.com>
Reviewed-by: Peter Chen <peter.chen@....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
Powered by blists - more mailing lists