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 <richardcochran@gmail.com>master
parent
5aa19dd3f4
commit
44c06f5d44
3
util.h
3
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue