Reviewed-by: Jacob Keller <jacob.e.kel...@intel.com>

On 5/16/2020 8:03 AM, Richard Cochran wrote:
> The utility function to compare port IDs takes pointers, but it only needs
> to read the referenced data.  This patch marks the parameters as const,
> allowing passing constants in the future.
> 
> Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
> ---
>  util.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/util.h b/util.h
> index 6e104ea..41e33d4 100644
> --- a/util.h
> +++ b/util.h
> @@ -131,7 +131,8 @@ clockid_t posix_clock_open(const char *device, int 
> *phc_index);
>   * @param b  Second port identity.
>   * @return   1 if identities are equal, 0 otherwise.
>   */
> -static inline int pid_eq(struct PortIdentity *a, struct PortIdentity *b)
> +static inline int pid_eq(const struct PortIdentity *a,
> +                      const struct PortIdentity *b)
>  {
>       return memcmp(a, b, sizeof(*a)) == 0;
>  }
> 


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to