Commit 8870261a authored by Yang Jihong's avatar Yang Jihong Committed by Namhyung Kim

perf bench messaging: Fix coding style issues for sched-messaging

Fixed several code style issues in sched-messaging:
1. Use one space around "-" and "+" operators.
2. When a long line is broken, the operator is at the end of the line.
Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20230923093037.961232-2-yangjihong1@huawei.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent cefff1f3
...@@ -98,7 +98,7 @@ static void *sender(struct sender_context *ctx) ...@@ -98,7 +98,7 @@ static void *sender(struct sender_context *ctx)
again: again:
ret = write(ctx->out_fds[j], data + done, ret = write(ctx->out_fds[j], data + done,
sizeof(data)-done); sizeof(data) - done);
if (ret < 0) if (ret < 0)
err(EXIT_FAILURE, "SENDER: write"); err(EXIT_FAILURE, "SENDER: write");
done += ret; done += ret;
...@@ -201,8 +201,8 @@ static unsigned int group(pthread_t *pth, ...@@ -201,8 +201,8 @@ static unsigned int group(pthread_t *pth,
int wakefd) int wakefd)
{ {
unsigned int i; unsigned int i;
struct sender_context *snd_ctx = malloc(sizeof(struct sender_context) struct sender_context *snd_ctx = malloc(sizeof(struct sender_context) +
+ num_fds * sizeof(int)); num_fds * sizeof(int));
if (!snd_ctx) if (!snd_ctx)
err(EXIT_FAILURE, "malloc()"); err(EXIT_FAILURE, "malloc()");
...@@ -239,7 +239,7 @@ static unsigned int group(pthread_t *pth, ...@@ -239,7 +239,7 @@ static unsigned int group(pthread_t *pth,
snd_ctx->wakefd = wakefd; snd_ctx->wakefd = wakefd;
snd_ctx->num_fds = num_fds; snd_ctx->num_fds = num_fds;
pth[num_fds+i] = create_worker(snd_ctx, (void *)sender); pth[num_fds + i] = create_worker(snd_ctx, (void *)sender);
} }
/* Close the fds we have left */ /* Close the fds we have left */
...@@ -288,7 +288,7 @@ int bench_sched_messaging(int argc, const char **argv) ...@@ -288,7 +288,7 @@ int bench_sched_messaging(int argc, const char **argv)
total_children = 0; total_children = 0;
for (i = 0; i < num_groups; i++) for (i = 0; i < num_groups; i++)
total_children += group(pth_tab+total_children, num_fds, total_children += group(pth_tab + total_children, num_fds,
readyfds[1], wakefds[0]); readyfds[1], wakefds[0]);
/* Wait for everyone to be ready */ /* Wait for everyone to be ready */
......
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