diff mbox series

[net-next,09/11] net: mscc: ocelot: make ocelot_init_timestamp take a const struct ptp_clock_info

Message ID 20200918105753.3473725-10-olteanv@gmail.com
State Accepted
Delegated to: David Miller
Headers show
Series Felix DSA driver cleanup: build Seville separately | expand

Commit Message

Vladimir Oltean Sept. 18, 2020, 10:57 a.m. UTC
From: Vladimir Oltean <vladimir.oltean@nxp.com>

It is a good measure to ensure correctness if the structures that are
meant to remain constant are only processed by functions that thake
constant arguments.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot_ptp.c | 3 ++-
 include/soc/mscc/ocelot_ptp.h          | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Alexandre Belloni Sept. 18, 2020, 3:31 p.m. UTC | #1
On 18/09/2020 13:57:51+0300, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> It is a good measure to ensure correctness if the structures that are
> meant to remain constant are only processed by functions that thake
> constant arguments.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  drivers/net/ethernet/mscc/ocelot_ptp.c | 3 ++-
>  include/soc/mscc/ocelot_ptp.h          | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mscc/ocelot_ptp.c b/drivers/net/ethernet/mscc/ocelot_ptp.c
> index 1e08fe4daaef..a33ab315cc6b 100644
> --- a/drivers/net/ethernet/mscc/ocelot_ptp.c
> +++ b/drivers/net/ethernet/mscc/ocelot_ptp.c
> @@ -300,7 +300,8 @@ int ocelot_ptp_enable(struct ptp_clock_info *ptp,
>  }
>  EXPORT_SYMBOL(ocelot_ptp_enable);
>  
> -int ocelot_init_timestamp(struct ocelot *ocelot, struct ptp_clock_info *info)
> +int ocelot_init_timestamp(struct ocelot *ocelot,
> +			  const struct ptp_clock_info *info)
>  {
>  	struct ptp_clock *ptp_clock;
>  	int i;
> diff --git a/include/soc/mscc/ocelot_ptp.h b/include/soc/mscc/ocelot_ptp.h
> index 4a6b2f71b6b2..6a7388fa7cc5 100644
> --- a/include/soc/mscc/ocelot_ptp.h
> +++ b/include/soc/mscc/ocelot_ptp.h
> @@ -53,6 +53,7 @@ int ocelot_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
>  		      enum ptp_pin_function func, unsigned int chan);
>  int ocelot_ptp_enable(struct ptp_clock_info *ptp,
>  		      struct ptp_clock_request *rq, int on);
> -int ocelot_init_timestamp(struct ocelot *ocelot, struct ptp_clock_info *info);
> +int ocelot_init_timestamp(struct ocelot *ocelot,
> +			  const struct ptp_clock_info *info);
>  int ocelot_deinit_timestamp(struct ocelot *ocelot);
>  #endif
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mscc/ocelot_ptp.c b/drivers/net/ethernet/mscc/ocelot_ptp.c
index 1e08fe4daaef..a33ab315cc6b 100644
--- a/drivers/net/ethernet/mscc/ocelot_ptp.c
+++ b/drivers/net/ethernet/mscc/ocelot_ptp.c
@@ -300,7 +300,8 @@  int ocelot_ptp_enable(struct ptp_clock_info *ptp,
 }
 EXPORT_SYMBOL(ocelot_ptp_enable);
 
-int ocelot_init_timestamp(struct ocelot *ocelot, struct ptp_clock_info *info)
+int ocelot_init_timestamp(struct ocelot *ocelot,
+			  const struct ptp_clock_info *info)
 {
 	struct ptp_clock *ptp_clock;
 	int i;
diff --git a/include/soc/mscc/ocelot_ptp.h b/include/soc/mscc/ocelot_ptp.h
index 4a6b2f71b6b2..6a7388fa7cc5 100644
--- a/include/soc/mscc/ocelot_ptp.h
+++ b/include/soc/mscc/ocelot_ptp.h
@@ -53,6 +53,7 @@  int ocelot_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
 		      enum ptp_pin_function func, unsigned int chan);
 int ocelot_ptp_enable(struct ptp_clock_info *ptp,
 		      struct ptp_clock_request *rq, int on);
-int ocelot_init_timestamp(struct ocelot *ocelot, struct ptp_clock_info *info);
+int ocelot_init_timestamp(struct ocelot *ocelot,
+			  const struct ptp_clock_info *info);
 int ocelot_deinit_timestamp(struct ocelot *ocelot);
 #endif