Commit e7285749 authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Jim Harris
Browse files

lib/util: return const pointer from spdk_cpuset_fmt




Change-Id: Iab5f9703ae9235fd3820228127d72e85af9826bc
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/400601


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d6408c0d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -136,8 +136,10 @@ uint32_t spdk_cpuset_count(const struct spdk_cpuset *set);
 * \param CPU set.
 * \return Pointer to hexadecimal representation of CPU set. Buffer to store a
 * 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.
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ spdk_cpuset_count(const struct spdk_cpuset *set)
	return count;
}

char *
const char *
spdk_cpuset_fmt(struct spdk_cpuset *set)
{
	uint32_t lcore, lcore_max = 0;
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ test_cpuset_fmt(void)
	int i;
	uint32_t lcore;
	struct spdk_cpuset *core_mask = spdk_cpuset_alloc();
	char *hex_mask;
	const char *hex_mask;
	char hex_mask_ref[SPDK_CPUSET_SIZE / 4 + 1];

	/* Clear coremask. hex_mask should be "0" */