diff mbox series

[v2,2/2] selftests: mqueue: drop duplicate min definition

Message ID 36201289cc9281ea7653127b0008ba01a1c14290.1649424565.git.geliang.tang@suse.com (mailing list archive)
State New
Headers show
Series drop duplicate max/min definitions | expand

Commit Message

Geliang Tang April 8, 2022, 1:36 p.m. UTC
Drop duplicate macro min() definition in mq_perf_tests.c, use MIN() in
sys/param.h instead.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 tools/testing/selftests/mqueue/mq_perf_tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Shuah Khan April 8, 2022, 7:23 p.m. UTC | #1
On 4/8/22 7:36 AM, Geliang Tang wrote:
> Drop duplicate macro min() definition in mq_perf_tests.c, use MIN() in
> sys/param.h instead.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---

Thank you. I will apply this for next.

thanks,
-- Shuah
Geliang Tang April 13, 2022, 10:51 a.m. UTC | #2
On Fri, Apr 08, 2022 at 01:23:52PM -0600, Shuah Khan wrote:
> On 4/8/22 7:36 AM, Geliang Tang wrote:
> > Drop duplicate macro min() definition in mq_perf_tests.c, use MIN() in
> > sys/param.h instead.
> > 
> > Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> > ---
> 
> Thank you. I will apply this for next.

Thanks very much.

I had sent a v3 of this patch, but it's the same as this one. So apply any
one is OK.

Thanks,
-Geliang

> 
> thanks,
> -- Shuah
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c
index b019e0b8221c..6df1b2a7ec88 100644
--- a/tools/testing/selftests/mqueue/mq_perf_tests.c
+++ b/tools/testing/selftests/mqueue/mq_perf_tests.c
@@ -35,6 +35,7 @@ 
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <mqueue.h>
 #include <popt.h>
 #include <error.h>
@@ -73,7 +74,6 @@  static char *usage =
 char *MAX_MSGS = "/proc/sys/fs/mqueue/msg_max";
 char *MAX_MSGSIZE = "/proc/sys/fs/mqueue/msgsize_max";
 
-#define min(a, b) ((a) < (b) ? (a) : (b))
 #define MAX_CPUS 64
 char *cpu_option_string;
 int cpus_to_pin[MAX_CPUS];
@@ -551,7 +551,7 @@  int main(int argc, char *argv[])
 		perror("sysconf(_SC_NPROCESSORS_ONLN)");
 		exit(1);
 	}
-	cpus_online = min(MAX_CPUS, sysconf(_SC_NPROCESSORS_ONLN));
+	cpus_online = MIN(MAX_CPUS, sysconf(_SC_NPROCESSORS_ONLN));
 	cpu_set = CPU_ALLOC(cpus_online);
 	if (cpu_set == NULL) {
 		perror("CPU_ALLOC()");