Commit abd26d34 authored by Geliang Tang's avatar Geliang Tang Committed by Shuah Khan

selftests: mqueue: drop duplicate min definition

Drop duplicate macro min() definition in mq_perf_tests.c, use MIN() in
sys/param.h instead.
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent d490527d
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/param.h>
#include <mqueue.h> #include <mqueue.h>
#include <popt.h> #include <popt.h>
#include <error.h> #include <error.h>
...@@ -73,7 +74,6 @@ static char *usage = ...@@ -73,7 +74,6 @@ static char *usage =
char *MAX_MSGS = "/proc/sys/fs/mqueue/msg_max"; char *MAX_MSGS = "/proc/sys/fs/mqueue/msg_max";
char *MAX_MSGSIZE = "/proc/sys/fs/mqueue/msgsize_max"; char *MAX_MSGSIZE = "/proc/sys/fs/mqueue/msgsize_max";
#define min(a, b) ((a) < (b) ? (a) : (b))
#define MAX_CPUS 64 #define MAX_CPUS 64
char *cpu_option_string; char *cpu_option_string;
int cpus_to_pin[MAX_CPUS]; int cpus_to_pin[MAX_CPUS];
...@@ -560,7 +560,7 @@ int main(int argc, char *argv[]) ...@@ -560,7 +560,7 @@ int main(int argc, char *argv[])
"require root in order to modify\nsystem settings. " "require root in order to modify\nsystem settings. "
"Exiting.\n"); "Exiting.\n");
cpus_online = min(MAX_CPUS, sysconf(_SC_NPROCESSORS_ONLN)); cpus_online = MIN(MAX_CPUS, sysconf(_SC_NPROCESSORS_ONLN));
cpu_set = CPU_ALLOC(cpus_online); cpu_set = CPU_ALLOC(cpus_online);
if (cpu_set == NULL) { if (cpu_set == NULL) {
perror("CPU_ALLOC()"); perror("CPU_ALLOC()");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment