lib/util: return const pointer from spdk_cpuset_fmt
Change-Id: Iab5f9703ae9235fd3820228127d72e85af9826bc Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/400601 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
d6408c0dd1
commit
e7285749ed
@ -136,8 +136,10 @@ uint32_t spdk_cpuset_count(const struct spdk_cpuset *set);
|
|||||||
* \param CPU set.
|
* \param CPU set.
|
||||||
* \return Pointer to hexadecimal representation of CPU set. Buffer to store a
|
* \return Pointer to hexadecimal representation of CPU set. Buffer to store a
|
||||||
* string is dynamically allocated internally and freed with CPU set object.
|
* string is dynamically allocated internally and freed with CPU set object.
|
||||||
|
* Memory returned by this function might be changed after subsequent calls to
|
||||||
|
* this function so string should be copied by user.
|
||||||
*/
|
*/
|
||||||
char *spdk_cpuset_fmt(struct spdk_cpuset *set);
|
const char *spdk_cpuset_fmt(struct spdk_cpuset *set);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a string containing a CPU core mask into a CPU set.
|
* Convert a string containing a CPU core mask into a CPU set.
|
||||||
|
@ -132,7 +132,7 @@ spdk_cpuset_count(const struct spdk_cpuset *set)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
spdk_cpuset_fmt(struct spdk_cpuset *set)
|
spdk_cpuset_fmt(struct spdk_cpuset *set)
|
||||||
{
|
{
|
||||||
uint32_t lcore, lcore_max = 0;
|
uint32_t lcore, lcore_max = 0;
|
||||||
|
@ -189,7 +189,7 @@ test_cpuset_fmt(void)
|
|||||||
int i;
|
int i;
|
||||||
uint32_t lcore;
|
uint32_t lcore;
|
||||||
struct spdk_cpuset *core_mask = spdk_cpuset_alloc();
|
struct spdk_cpuset *core_mask = spdk_cpuset_alloc();
|
||||||
char *hex_mask;
|
const char *hex_mask;
|
||||||
char hex_mask_ref[SPDK_CPUSET_SIZE / 4 + 1];
|
char hex_mask_ref[SPDK_CPUSET_SIZE / 4 + 1];
|
||||||
|
|
||||||
/* Clear coremask. hex_mask should be "0" */
|
/* Clear coremask. hex_mask should be "0" */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user