From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F2F5423F4; Tue, 17 Jan 2023 01:15:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C279942D2D; Tue, 17 Jan 2023 01:15:03 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id D3EDA410EE for ; Tue, 17 Jan 2023 01:15:01 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id jn22so31821073plb.13 for ; Mon, 16 Jan 2023 16:15:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PGEhCx7Yt1keqFwdhUEy9OtDVM8hw8PG74jugv5Q+6Q=; b=jSpjvrofyLbtbSWqCuWPB1vuFIagrGpLJ7I15VMUaBRRYFpp0bpcHXwCVHulByaZQ4 mA/m5RrJ++ROIvm/wxEWqs12soNt8vU/KKrOp4AunFKOxA5XIvIGuVbrEn0FNKF8HcS1 9EImnVudKB67winHCld6MOJFxqmbuoexQ5yyfiLhsOxhE4meDYZ0i88SBL5Zq+mMb0r0 7iECJydsS/YaAsvWwkIrS8gQtXyvCdv4IP6VSx4Y6rPXxTxsgEB753nzy0mPnSPI7bpA keCYuP5MGSKbbnszpwAeCuHI9YbGy+uEns70JdaYtjKNlafl7zrN81CDoBn17/N/ioPe 19Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PGEhCx7Yt1keqFwdhUEy9OtDVM8hw8PG74jugv5Q+6Q=; b=65dlb6mkUbFpdSTo4xvnukCxxSm2aX7+zRTAuzjt5kEZazbcvOPS20B/dtVxegZR02 Z2cW4mieuMqnuno0qmiiydYeg1kqsJG+INabknhdFrkFfIQjlRTIMnQikV6571mGgr5b HfAi+VZnqcERPITB7IbJdYCwNTGJcU+Y+bVT/uyznDW7iD5XvprU8TDxfD/n3FseqlFA VSJ5cE9vKO9379xWTheeFECIzyAytviURFHe/bXOMn4wJy9bBFuWIBut/P7dVK9iOSBF Lsq1U3Rpg9bKUJMXihhw/qC4jcgkGBgZIrCYZVeI4/LMNhLP/q85hf/Op3EAu2ZVqCNN 5BCA== X-Gm-Message-State: AFqh2kouEyOcsUnA1A9P+pHRQRWr6PNww8C57ZtJimUcf1CVkS8QgJV8 VoNXQd0n3k7cAYiUmPMo6IMgo3FQvn7r2nujweA= X-Google-Smtp-Source: AMrXdXspuM54vx1Fkp2gc8gK5IwzZ1hgCDK4CZyvuaQJ6HSfEbDGZqERysgD7P7kp8rRWBcryzR2Tw== X-Received: by 2002:a05:6a20:54a7:b0:b8:3131:75cc with SMTP id i39-20020a056a2054a700b000b8313175ccmr963898pzk.19.1673914500691; Mon, 16 Jan 2023 16:15:00 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id z24-20020a630a58000000b004790eb3fee1sm15940614pgk.90.2023.01.16.16.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 16:15:00 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev , David Hunt , Anatoly Burakov , Cristian Dumitrescu Subject: [PATCH v3 5/7] examples: fix whitespace Date: Mon, 16 Jan 2023 16:14:51 -0800 Message-Id: <20230117001453.94082-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230117001453.94082-1-stephen@networkplumber.org> References: <20230116172732.84976-1-stephen@networkplumber.org> <20230117001453.94082-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The style standard is to use blank after keywords. I.e "if (" not "if(" Signed-off-by: Stephen Hemminger --- examples/ip_reassembly/main.c | 2 +- examples/l3fwd-power/main.c | 9 +++++---- examples/l3fwd/main.c | 9 +++++---- examples/multi_process/symmetric_mp/main.c | 6 +++--- examples/qos_sched/app_thread.c | 6 +++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 2 +- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index bd0b1d31decf..7e84b4944759 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port) TX_LCORE_STAT_UPDATE(&qconf->tx_stat, queue, 1); txmb->m_table[txmb->head] = m; - if(++txmb->head == len) + if (++txmb->head == len) txmb->head = 0; return 0; diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd3ade330f82..513a1b21a69e 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1785,13 +1785,14 @@ parse_config(const char *q_arg) nb_lcore_params = 0; - while ((p = strchr(p0,'(')) != NULL) { + while ((p = strchr(p0, '(')) != NULL) { ++p; - if((p0 = strchr(p,')')) == NULL) + p0 = strchr(p, ')'); + if (p0 == NULL) return -1; size = p0 - p; - if(size >= sizeof(s)) + if (size >= sizeof(s)) return -1; snprintf(s, sizeof(s), "%.*s", size, p); @@ -2946,7 +2947,7 @@ main(int argc, char **argv) fflush(stdout); /* init RX queues */ - for(queue = 0; queue < qconf->n_rx_queue; ++queue) { + for (queue = 0; queue < qconf->n_rx_queue; ++queue) { struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 5198ff30dd00..687a81892aad 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -514,13 +514,14 @@ parse_config(const char *q_arg) nb_lcore_params = 0; - while ((p = strchr(p0,'(')) != NULL) { + while ((p = strchr(p0, '(')) != NULL) { ++p; - if((p0 = strchr(p,')')) == NULL) + p0 = strchr(p, ')'); + if (p0 == NULL) return -1; size = p0 - p; - if(size >= sizeof(s)) + if (size >= sizeof(s)) return -1; snprintf(s, sizeof(s), "%.*s", size, p); @@ -1366,7 +1367,7 @@ l3fwd_poll_resource_setup(void) printf("\nInitializing rx queues on lcore %u ... ", lcore_id ); fflush(stdout); /* init RX queues */ - for(queue = 0; queue < qconf->n_rx_queue; ++queue) { + for (queue = 0; queue < qconf->n_rx_queue; ++queue) { struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id; diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 1ff85875dfdf..9c5348bd36ed 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv) /* get the port numbers from the port mask */ RTE_ETH_FOREACH_DEV(i) - if(port_mask & (1 << i)) + if (port_mask & (1 << i)) ports[num_ports++] = (uint8_t)i; ret = optind-1; @@ -470,8 +470,8 @@ main(int argc, char **argv) /* Primary instance initialized. 8< */ if (num_ports & 1) rte_exit(EXIT_FAILURE, "Application must use an even number of ports\n"); - for(i = 0; i < num_ports; i++){ - if(proc_type == RTE_PROC_PRIMARY) + for (i = 0; i < num_ports; i++){ + if (proc_type == RTE_PROC_PRIMARY) if (smp_port_init(ports[i], mp, (uint16_t)num_procs) < 0) rte_exit(EXIT_FAILURE, "Error initialising ports\n"); } diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c index dbc878b55394..a49356fecf5f 100644 --- a/examples/qos_sched/app_thread.c +++ b/examples/qos_sched/app_thread.c @@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs) if (likely(nb_rx != 0)) { APP_STATS_ADD(conf->stat.nb_rx, nb_rx); - for(i = 0; i < nb_rx; i++) { + for (i = 0; i < nb_rx; i++) { get_pkt_sched(rx_mbufs[i], &subport, &pipe, &traffic_class, &queue, &color); rte_sched_port_pkt_write(conf->sched_port, @@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs) if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring, (void **)rx_mbufs, nb_rx, NULL) == 0)) { - for(i = 0; i < nb_rx; i++) { + for (i = 0; i < nb_rx; i++) { rte_pktmbuf_free(rx_mbufs[i]); APP_STATS_ADD(conf->stat.nb_drop, 1); @@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nb uint32_t i, len; len = qconf->n_mbufs; - for(i = 0; i < nb_pkt; i++) { + for (i = 0; i < nb_pkt; i++) { qconf->m_table[len] = mbufs[i]; len++; /* enough pkts to be sent */ diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index b2959499ae9a..b752eb221f7c 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv) /* sanity check for cores assignment */ nb_lcores = app_cpu_core_count(); - for(i = 0; i < nb_pfc; i++) { + for (i = 0; i < nb_pfc; i++) { if (qos_conf[i].rx_core >= nb_lcores) { RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1, qos_conf[i].rx_core); diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 0709aec10c31..41b46b296298 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -323,7 +323,7 @@ int app_init(void) rte_exit(EXIT_FAILURE, "Invalid configuration profile\n"); /* Initialize each active flow */ - for(i = 0; i < nb_pfc; i++) { + for (i = 0; i < nb_pfc; i++) { uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core); struct rte_ring *ring; diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index dc6a17a6464a..366f9125268c 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -152,7 +152,7 @@ app_stat(void) static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS]; /* print statistics */ - for(i = 0; i < nb_pfc; i++) { + for (i = 0; i < nb_pfc; i++) { struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); -- 2.39.0