utils: Constify the posix clock interface.

The function to open a posix clock never modifies the passed in
string.  This patch adds the const keyword to ensure this function
stays that way.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
master
Richard Cochran 2020-02-09 11:15:43 -08:00
parent e4d1988f54
commit 9dcd6c31e7
2 changed files with 2 additions and 2 deletions

2
util.c
View File

@ -190,7 +190,7 @@ char *portaddr2str(struct PortAddress *addr)
return buf; return buf;
} }
clockid_t posix_clock_open(char *device, int *phc_index) clockid_t posix_clock_open(const char *device, int *phc_index)
{ {
struct sk_ts_info ts_info; struct sk_ts_info ts_info;
char phc_device[19]; char phc_device[19];

2
util.h
View File

@ -116,7 +116,7 @@ char *portaddr2str(struct PortAddress *addr);
* @param phc_index Returns the PHC index, if any. * @param phc_index Returns the PHC index, if any.
* @return A valid clock ID on success or CLOCK_INVALID otherwise. * @return A valid clock ID on success or CLOCK_INVALID otherwise.
*/ */
clockid_t posix_clock_open(char *device, int *phc_index); clockid_t posix_clock_open(const char *device, int *phc_index);
/** /**
* Compare two port identities for equality. * Compare two port identities for equality.