[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-rt-users
Subject: [PATCH 11/16] rt-tests: cyclicdeadline.c: Fix spacing around commas
From: John Kacur <jkacur () redhat ! com>
Date: 2020-10-29 17:40:52
Message-ID: 20201029174057.20033-12-jkacur () redhat ! com
[Download RAW message or body]
Fix spacing around commas and remove unnecessary brackets
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/sched_deadline/cyclicdeadline.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
index 5f5cdfa08f14..a6309ded3c52 100644
--- a/src/sched_deadline/cyclicdeadline.c
+++ b/src/sched_deadline/cyclicdeadline.c
@@ -112,7 +112,7 @@ static int find_mount(const char *mount, char *debugfs)
char type[100];
FILE *fp;
- if ((fp = fopen("/proc/mounts","r")) == NULL)
+ if ((fp = fopen("/proc/mounts", "r")) == NULL)
return 0;
while (fscanf(fp, "%*s %"
@@ -139,7 +139,7 @@ static const char *find_debugfs(void)
if (!find_mount("debugfs", debugfs))
return "";
-
+
debugfs_found = 1;
return debugfs;
@@ -518,8 +518,8 @@ static const char *make_cpuset(const char *name, const char *cpus,
fd = open_cpuset(path, "tasks");
snprintf(path, MAXPATH - 1, "%s/tasks", CPUSET_PATH);
- if ((fp = fopen(path,"r")) == NULL) {
- close (fd);
+ if ((fp = fopen(path, "r")) == NULL) {
+ close(fd);
return "opening cpuset tasks";
}
@@ -565,7 +565,7 @@ static void destroy_cpuset(const char *name, int print)
again:
strncat(path, "/tasks", MAXPATH - 1);
- if ((fp = fopen(path,"r")) == NULL) {
+ if ((fp = fopen(path, "r")) == NULL) {
fprintf(stderr, "Failed opening %s\n", path);
perror("fopen");
return;
@@ -792,7 +792,7 @@ void *run_deadline(void *data)
sched_yield();
period = get_time_us();
-
+
while (!shutdown) {
period = do_runtime(tid, sd, period);
sched_yield();
@@ -997,19 +997,17 @@ static void loop(struct sched_data *sched_data, int nr_threads)
int i;
while (!shutdown) {
- for (i = 0; i < nr_threads; i++) {
+ for (i = 0; i < nr_threads; i++)
print_stat(stdout, &sched_data[i], i, 0, 0);
- }
usleep(10000);
printf("\033[%dA", nr_threads);
}
usleep(10000);
- for (i = 0; i < nr_threads; i++) {
+ for (i = 0; i < nr_threads; i++)
printf("\n");
- }
}
-int main (int argc, char **argv)
+int main(int argc, char **argv)
{
struct sched_data *sched_data;
struct sched_data *sd;
@@ -1111,9 +1109,8 @@ int main (int argc, char **argv)
if (setcpu)
make_other_cpu_list(setcpu, &allcpu_buf);
- if (mlockall(MCL_CURRENT|MCL_FUTURE) == -1) {
+ if (mlockall(MCL_CURRENT|MCL_FUTURE) == -1)
perror("mlockall");
- }
setup_ftrace_marker();
--
2.26.2
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic