From patchwork Sat Sep 23 09:30:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 143857 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp76143vqu; Sat, 23 Sep 2023 02:33:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzqtYkzO0ij0ti5sc+ZC6tlvl+nii0WAQV5otlvvG0vqL+oD4ud7s/D3x3YIoAi+i3RJSK X-Received: by 2002:a05:6870:291:b0:1d6:5649:a88e with SMTP id q17-20020a056870029100b001d65649a88emr2111698oaf.37.1695461597065; Sat, 23 Sep 2023 02:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695461597; cv=none; d=google.com; s=arc-20160816; b=lfFZBDZAkd0WjTaP22I97fESPQgZ1PxCDsZPj+AhRA74HXR08jquAS0M+JYCrR501f JdZrHr6xfQa+s0/U6ATPNjUtI/IHP3JssJcLkB6gyqnyAhBE9A0jJCp5a6JsaTh9TU4R 0ypkhN+WOKEHPEkPGc3zvy/QMbF2aQBb5cnJx3+zG383pZ8/RI2wpx583R0bixRAbEwc 2IdhmJ+8hHUeQhCwOKbkC4uZilg3OSx/4SjlJ7XWxmjfskw3b0bl3fVai5WpakFWPRzo rpFvMJa2PBj8cJPujHQjDObk52E9AMuPrEfi+PIIXUrLTsib0u38dfjpcUzsOeioxzUc o7Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gmL06ZMpmAZcvjI7+9mA+sZqLuR+U1EnAjpISAOeglc=; fh=JXx1mv1fB650HoTkc5GIgpDQ5Ey550GcDyaNZ/s6bYc=; b=JhI8gyg4jdf5No/OYSPjvrSMcEdszgEyOXKCU6KkbRXWnRSICbcJt2zuoop7Q+bCVs tr+Us+Tc1Nw8P1w3erzAL2/0zyM8IeOoiSAOFYR++4hGh7Fm2DVxtlPWBS6tNGN9eABL K9DZwlR65P5+1qojO6g2xPq6gWO4UB3+LXlPQ32mUSuZpxTOQFFKjTNjEmVNfATiZgoc LVnlDwmdJIRqkzbErxmMV5mlg/s8C/1EoOBKJvWGX5E6otIOYKrjtTD3nMJZGZ5M4vYO 6SzDtOA/uzwASj+g+oC1bkaQ1qFv33ZXk1+2DySfg1O6EVY8DfcOFPNymICsGBQHPmz3 lpUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id cw10-20020a056a00450a00b0068c0042d3c9si5434676pfb.239.2023.09.23.02.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 02:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8F5FD839A541; Sat, 23 Sep 2023 02:32:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbjIWJcU (ORCPT + 29 others); Sat, 23 Sep 2023 05:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbjIWJcQ (ORCPT ); Sat, 23 Sep 2023 05:32:16 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DDA4196; Sat, 23 Sep 2023 02:32:10 -0700 (PDT) Received: from kwepemm000003.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Rt3ks6Pzxz15NJV; Sat, 23 Sep 2023 17:29:57 +0800 (CST) Received: from ubuntu2204.huawei.com (10.67.174.22) by kwepemm000003.china.huawei.com (7.193.23.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 23 Sep 2023 17:32:07 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 1/4] perf bench messaging: Fix coding style issues for sched-messaging Date: Sat, 23 Sep 2023 09:30:34 +0000 Message-ID: <20230923093037.961232-2-yangjihong1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230923093037.961232-1-yangjihong1@huawei.com> References: <20230923093037.961232-1-yangjihong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.174.22] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm000003.china.huawei.com (7.193.23.66) X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 23 Sep 2023 02:32:26 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777820339584991101 X-GMAIL-MSGID: 1777820339584991101 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: Yang Jihong Reviewed-by: Ian Rogers --- tools/perf/bench/sched-messaging.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c index fa1f8f998814..6a33118c8f9b 100644 --- a/tools/perf/bench/sched-messaging.c +++ b/tools/perf/bench/sched-messaging.c @@ -98,7 +98,7 @@ static void *sender(struct sender_context *ctx) again: ret = write(ctx->out_fds[j], data + done, - sizeof(data)-done); + sizeof(data) - done); if (ret < 0) err(EXIT_FAILURE, "SENDER: write"); done += ret; @@ -201,8 +201,8 @@ static unsigned int group(pthread_t *pth, int wakefd) { unsigned int i; - struct sender_context *snd_ctx = malloc(sizeof(struct sender_context) - + num_fds * sizeof(int)); + struct sender_context *snd_ctx = malloc(sizeof(struct sender_context) + + num_fds * sizeof(int)); if (!snd_ctx) err(EXIT_FAILURE, "malloc()"); @@ -239,7 +239,7 @@ static unsigned int group(pthread_t *pth, snd_ctx->wakefd = wakefd; 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 */ @@ -288,7 +288,7 @@ int bench_sched_messaging(int argc, const char **argv) total_children = 0; 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]); /* Wait for everyone to be ready */