From 44c06f5d445f7dcd94eb9f190738cb01f66e6597 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Mon, 13 Apr 2020 19:02:25 -0700 Subject: [PATCH] util: Mark port identity comparisons as const. 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 --- 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; }