diff mbox

[PATCHv3,2/9] api: cpumask: reorder the input vars to match convention

Message ID 1421275706-11176-3-git-send-email-anders.roxell@linaro.org
State Accepted
Commit 17112e3cb916eec2822f16677c32017100b6dcde
Headers show

Commit Message

Anders Roxell Jan. 14, 2015, 10:48 p.m. UTC
From: Robbie King <robking@cisco.com>

Have the destination variable as the first parameter to match the rest of the
ODP API.

Signed-off-by: Robbie King <robking@cisco.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 platform/linux-generic/include/api/odp_cpumask.h | 20 ++++++++++----------
 platform/linux-generic/odp_cpumask.c             | 12 ++++++------
 test/api_test/odp_common.c                       |  4 ++--
 3 files changed, 18 insertions(+), 18 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_cpumask.h b/platform/linux-generic/include/api/odp_cpumask.h
index e421d4d..2e10c4e 100644
--- a/platform/linux-generic/include/api/odp_cpumask.h
+++ b/platform/linux-generic/include/api/odp_cpumask.h
@@ -40,20 +40,20 @@  typedef struct odp_cpumask_t {
 /**
  * Add CPU mask bits from a string
  *
+ * @param mask   CPU mask to modify
  * @param str    Hexadecimal digits in a string. CPU #0 is located
  *               at the least significant bit (0x1).
- * @param mask   CPU mask to modify
  */
-void odp_cpumask_from_str(const char *str, odp_cpumask_t *mask);
+void odp_cpumask_from_str(odp_cpumask_t *mask, const char *str);
 
 /**
  * Write CPU mask as a string of hexadecimal digits
  *
+ * @param mask   CPU mask
  * @param str    String for output
  * @param len    Size of string length (incl. ending zero)
- * @param mask   CPU mask
  */
-void odp_cpumask_to_str(char *str, int len, const odp_cpumask_t *mask);
+void odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int len);
 
 /**
  * Clear entire mask
@@ -63,25 +63,25 @@  void odp_cpumask_zero(odp_cpumask_t *mask);
 
 /**
  * Add cpu to mask
- * @param cpu   CPU number
  * @param mask  add cpu number in CPU mask
+ * @param cpu   CPU number
  */
-void odp_cpumask_set(int cpu, odp_cpumask_t *mask);
+void odp_cpumask_set(odp_cpumask_t *mask, int cpu);
 
 /**
  * Remove cpu from mask
- * @param cpu   CPU number
  * @param mask  clear cpu number from CPU mask
+ * @param cpu   CPU number
  */
-void odp_cpumask_clr(int cpu, odp_cpumask_t *mask);
+void odp_cpumask_clr(odp_cpumask_t *mask, int cpu);
 
 /**
  * Test if cpu is a member of mask
- * @param cpu   CPU number
  * @param mask  CPU mask to check if cpu num set or not
+ * @param cpu   CPU number
  * @return      non-zero if set otherwise 0
  */
-int odp_cpumask_isset(int cpu, const odp_cpumask_t *mask);
+int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu);
 
 /**
  * Count number of cpus in mask
diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c
index 1f9d73b..0f383da 100644
--- a/platform/linux-generic/odp_cpumask.c
+++ b/platform/linux-generic/odp_cpumask.c
@@ -18,7 +18,7 @@ 
 #define MAX_CORE_NUM	64
 
 
-void odp_cpumask_from_str(const char *str_in, odp_cpumask_t *mask)
+void odp_cpumask_from_str(odp_cpumask_t *mask, const char *str_in)
 {
 	cpu_set_t cpuset;
 	const char *str = str_in;
@@ -68,12 +68,12 @@  static int _odp_cpumask_last(const odp_cpumask_t *mask)
 	int cpu;
 
 	for (cpu = CPU_SETSIZE - 1; cpu >= 0; cpu--)
-		if (odp_cpumask_isset(cpu, mask))
+		if (odp_cpumask_isset(mask, cpu))
 			return cpu;
 	return -1;
 }
 
-void odp_cpumask_to_str(char *str, int len, const odp_cpumask_t *mask)
+void odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int len)
 {
 	char *p = str;
 	int cpu = _odp_cpumask_last(mask);
@@ -130,17 +130,17 @@  void odp_cpumask_zero(odp_cpumask_t *mask)
 	CPU_ZERO(&mask->set);
 }
 
-void odp_cpumask_set(int cpu, odp_cpumask_t *mask)
+void odp_cpumask_set(odp_cpumask_t *mask, int cpu)
 {
 	CPU_SET(cpu, &mask->set);
 }
 
-void odp_cpumask_clr(int cpu, odp_cpumask_t *mask)
+void odp_cpumask_clr(odp_cpumask_t *mask, int cpu)
 {
 	CPU_CLR(cpu, &mask->set);
 }
 
-int odp_cpumask_isset(int cpu, const odp_cpumask_t *mask)
+int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu)
 {
 	return CPU_ISSET(cpu, &mask->set);
 }
diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
index 7449a52..3ea815e 100644
--- a/test/api_test/odp_common.c
+++ b/test/api_test/odp_common.c
@@ -36,8 +36,8 @@  void odp_print_system_info(void)
 
 	odp_cpumask_zero(&cpumask);
 
-	odp_cpumask_from_str("0x1", &cpumask);
-	odp_cpumask_to_str(str, sizeof(str), &cpumask);
+	odp_cpumask_from_str(&cpumask, "0x1");
+	odp_cpumask_to_str(&cpumask, str, sizeof(str));
 
 	printf("\n");
 	printf("ODP system info\n");