From patchwork Fri May 21 01:08:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 445152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60814C433B4 for ; Fri, 21 May 2021 01:11:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46394611AB for ; Fri, 21 May 2021 01:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236169AbhEUBMn (ORCPT ); Thu, 20 May 2021 21:12:43 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4563 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235906AbhEUBMj (ORCPT ); Thu, 20 May 2021 21:12:39 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FmT4r15S1zqVBj; Fri, 21 May 2021 09:08:28 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 1/6] net: wan: fix an code style issue about "foo* bar" Date: Fri, 21 May 2021 09:08:12 +0800 Message-ID: <1621559297-9651-2-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> References: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peng Li Fix the checkpatch error as "foo* bar" should be "foo *bar". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/hd64572.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index 9f60e3969bf8..e7d8653c4bde 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -54,7 +54,7 @@ static int sca_poll(struct napi_struct *napi, int budget); -static inline port_t* dev_to_port(struct net_device *dev) +static inline port_t *dev_to_port(struct net_device *dev) { return dev_to_hdlc(dev)->priv; } @@ -186,7 +186,7 @@ static void sca_init_port(port_t *port) static inline void sca_msci_intr(port_t *port) { u16 msci = get_msci(port); - card_t* card = port->card; + card_t *card = port->card; if (sca_in(msci + ST1, card) & ST1_CDCD) { /* Reset MSCI CDCD status bit */ @@ -286,7 +286,7 @@ static inline int sca_rx_done(port_t *port, int budget) static inline void sca_tx_done(port_t *port) { struct net_device *dev = port->netdev; - card_t* card = port->card; + card_t *card = port->card; u8 stat; unsigned count = 0; @@ -366,7 +366,7 @@ static irqreturn_t sca_intr(int irq, void *dev_id) static void sca_set_port(port_t *port) { - card_t* card = port->card; + card_t *card = port->card; u16 msci = get_msci(port); u8 md2 = sca_in(msci + MD2, card); unsigned int tmc, br = 10, brv = 1024; @@ -421,7 +421,7 @@ static void sca_set_port(port_t *port) static void sca_open(struct net_device *dev) { port_t *port = dev_to_port(dev); - card_t* card = port->card; + card_t *card = port->card; u16 msci = get_msci(port); u8 md0, md2; From patchwork Fri May 21 01:08:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 446222 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EBBBC43460 for ; Fri, 21 May 2021 01:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54F4A60FD8 for ; Fri, 21 May 2021 01:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236143AbhEUBMk (ORCPT ); Thu, 20 May 2021 21:12:40 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:3450 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235867AbhEUBMi (ORCPT ); Thu, 20 May 2021 21:12:38 -0400 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FmT4q49DKzBvPd; Fri, 21 May 2021 09:08:27 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 2/6] net: wan: add some required spaces Date: Fri, 21 May 2021 09:08:13 +0800 Message-ID: <1621559297-9651-3-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> References: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peng Li Add space required after that close brace '}'. Add space required before the open parenthesis '('. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/hd64572.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index e7d8653c4bde..e51d94d62e07 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -380,7 +380,7 @@ static void sca_set_port(port_t *port) /* Baud Rate = CLOCK_BASE / TMC / 2^BR */ tmc = CLOCK_BASE / brv / port->settings.clock_rate; - }while (br > 1 && tmc <= 128); + } while (br > 1 && tmc <= 128); if (tmc < 1) { tmc = 1; @@ -425,7 +425,7 @@ static void sca_open(struct net_device *dev) u16 msci = get_msci(port); u8 md0, md2; - switch(port->encoding) { + switch (port->encoding) { case ENCODING_NRZ: md2 = MD2_NRZ; break; case ENCODING_NRZI: md2 = MD2_NRZI; break; case ENCODING_FM_MARK: md2 = MD2_FM_MARK; break; @@ -436,7 +436,7 @@ static void sca_open(struct net_device *dev) if (port->settings.loopback) md2 |= MD2_LOOPBACK; - switch(port->parity) { + switch (port->parity) { case PARITY_CRC16_PR0: md0 = MD0_HDLC | MD0_CRC_16_0; break; case PARITY_CRC16_PR1: md0 = MD0_HDLC | MD0_CRC_16; break; case PARITY_CRC32_PR1_CCITT: md0 = MD0_HDLC | MD0_CRC_ITU32; break; From patchwork Fri May 21 01:08:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 445150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A194C43461 for ; Fri, 21 May 2021 01:11:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0915E61355 for ; Fri, 21 May 2021 01:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236167AbhEUBMl (ORCPT ); Thu, 20 May 2021 21:12:41 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:3451 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235874AbhEUBMj (ORCPT ); Thu, 20 May 2021 21:12:39 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FmT4q5SPVzBvPh; Fri, 21 May 2021 09:08:27 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 3/6] net: wan: fix the code style issue about trailing statements Date: Fri, 21 May 2021 09:08:14 +0800 Message-ID: <1621559297-9651-4-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> References: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peng Li Trailing statements should be on next line. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/hd64572.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index e51d94d62e07..aa69bcaba633 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -426,22 +426,40 @@ static void sca_open(struct net_device *dev) u8 md0, md2; switch (port->encoding) { - case ENCODING_NRZ: md2 = MD2_NRZ; break; - case ENCODING_NRZI: md2 = MD2_NRZI; break; - case ENCODING_FM_MARK: md2 = MD2_FM_MARK; break; - case ENCODING_FM_SPACE: md2 = MD2_FM_SPACE; break; - default: md2 = MD2_MANCHESTER; + case ENCODING_NRZ: + md2 = MD2_NRZ; + break; + case ENCODING_NRZI: + md2 = MD2_NRZI; + break; + case ENCODING_FM_MARK: + md2 = MD2_FM_MARK; + break; + case ENCODING_FM_SPACE: + md2 = MD2_FM_SPACE; + break; + default: + md2 = MD2_MANCHESTER; } if (port->settings.loopback) md2 |= MD2_LOOPBACK; switch (port->parity) { - case PARITY_CRC16_PR0: md0 = MD0_HDLC | MD0_CRC_16_0; break; - case PARITY_CRC16_PR1: md0 = MD0_HDLC | MD0_CRC_16; break; - case PARITY_CRC32_PR1_CCITT: md0 = MD0_HDLC | MD0_CRC_ITU32; break; - case PARITY_CRC16_PR1_CCITT: md0 = MD0_HDLC | MD0_CRC_ITU; break; - default: md0 = MD0_HDLC | MD0_CRC_NONE; + case PARITY_CRC16_PR0: + md0 = MD0_HDLC | MD0_CRC_16_0; + break; + case PARITY_CRC16_PR1: + md0 = MD0_HDLC | MD0_CRC_16; + break; + case PARITY_CRC32_PR1_CCITT: + md0 = MD0_HDLC | MD0_CRC_ITU32; + break; + case PARITY_CRC16_PR1_CCITT: + md0 = MD0_HDLC | MD0_CRC_ITU; + break; + default: + md0 = MD0_HDLC | MD0_CRC_NONE; } sca_out(CMD_RESET, msci + CMD, card); From patchwork Fri May 21 01:08:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 446223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C660EC43460 for ; Fri, 21 May 2021 01:11:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B04E361353 for ; Fri, 21 May 2021 01:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236392AbhEUBMs (ORCPT ); Thu, 20 May 2021 21:12:48 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4564 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235932AbhEUBMj (ORCPT ); Thu, 20 May 2021 21:12:39 -0400 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FmT4r44ZbzqVC8; Fri, 21 May 2021 09:08:28 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems702-chm.china.huawei.com (10.3.19.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 4/6] net: wan: remove redundant blank lines Date: Fri, 21 May 2021 09:08:15 +0800 Message-ID: <1621559297-9651-5-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> References: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peng Li This patch removes some redundant blank lines. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/hd64572.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index aa69bcaba633..34acea93efdf 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -81,14 +81,12 @@ static inline u16 desc_abs_number(port_t *port, u16 desc, int transmit) return port->chan * (rx_buffs + tx_buffs) + transmit * rx_buffs + desc; } - static inline u16 desc_offset(port_t *port, u16 desc, int transmit) { /* Descriptor offset always fits in 16 bits */ return desc_abs_number(port, desc, transmit) * sizeof(pkt_desc); } - static inline pkt_desc __iomem *desc_address(port_t *port, u16 desc, int transmit) { @@ -96,14 +94,12 @@ static inline pkt_desc __iomem *desc_address(port_t *port, u16 desc, desc_offset(port, desc, transmit)); } - static inline u32 buffer_offset(port_t *port, u16 desc, int transmit) { return port->card->buff_offset + desc_abs_number(port, desc, transmit) * (u32)HDLC_MAX_MRU; } - static inline void sca_set_carrier(port_t *port) { if (!(sca_in(get_msci(port) + ST3, port->card) & ST3_DCD)) { @@ -121,7 +117,6 @@ static inline void sca_set_carrier(port_t *port) } } - static void sca_init_port(port_t *port) { card_t *card = port->card; @@ -181,7 +176,6 @@ static void sca_init_port(port_t *port) netif_napi_add(port->netdev, &port->napi, sca_poll, NAPI_WEIGHT); } - /* MSCI interrupt service */ static inline void sca_msci_intr(port_t *port) { @@ -195,7 +189,6 @@ static inline void sca_msci_intr(port_t *port) } } - static inline void sca_rx(card_t *card, port_t *port, pkt_desc __iomem *desc, u16 rxin) { @@ -225,7 +218,6 @@ static inline void sca_rx(card_t *card, port_t *port, pkt_desc __iomem *desc, netif_receive_skb(skb); } - /* Receive DMA service */ static inline int sca_rx_done(port_t *port, int budget) { @@ -281,7 +273,6 @@ static inline int sca_rx_done(port_t *port, int budget) return received; } - /* Transmit DMA service */ static inline void sca_tx_done(port_t *port) { @@ -321,7 +312,6 @@ static inline void sca_tx_done(port_t *port) spin_unlock(&port->lock); } - static int sca_poll(struct napi_struct *napi, int budget) { port_t *port = container_of(napi, port_t, napi); @@ -363,7 +353,6 @@ static irqreturn_t sca_intr(int irq, void *dev_id) return IRQ_RETVAL(handled); } - static void sca_set_port(port_t *port) { card_t *card = port->card; @@ -371,7 +360,6 @@ static void sca_set_port(port_t *port) u8 md2 = sca_in(msci + MD2, card); unsigned int tmc, br = 10, brv = 1024; - if (port->settings.clock_rate > 0) { /* Try lower br for better accuracy*/ do { @@ -414,10 +402,8 @@ static void sca_set_port(port_t *port) md2 &= ~MD2_LOOPBACK; sca_out(md2, msci + MD2, card); - } - static void sca_open(struct net_device *dev) { port_t *port = dev_to_port(dev); @@ -494,7 +480,6 @@ static void sca_open(struct net_device *dev) netif_start_queue(dev); } - static void sca_close(struct net_device *dev) { port_t *port = dev_to_port(dev); @@ -506,7 +491,6 @@ static void sca_close(struct net_device *dev) netif_stop_queue(dev); } - static int sca_attach(struct net_device *dev, unsigned short encoding, unsigned short parity) { @@ -529,7 +513,6 @@ static int sca_attach(struct net_device *dev, unsigned short encoding, return 0; } - #ifdef DEBUG_RINGS static void sca_dump_rings(struct net_device *dev) { @@ -576,7 +559,6 @@ static void sca_dump_rings(struct net_device *dev) } #endif /* DEBUG_RINGS */ - static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) { port_t *port = dev_to_port(dev); @@ -618,7 +600,6 @@ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_OK; } - static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase, u32 ramsize) { /* Round RAM size to 32 bits, fill from end to start */ @@ -637,7 +618,6 @@ static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase, u32 ramsize) return i; } - static void sca_init(card_t *card, int wait_states) { sca_out(wait_states, WCRL, card); /* Wait Control */ From patchwork Fri May 21 01:08:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 445151 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22B82C433B4 for ; Fri, 21 May 2021 01:11:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0414A611AB for ; Fri, 21 May 2021 01:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236318AbhEUBMq (ORCPT ); Thu, 20 May 2021 21:12:46 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5707 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236071AbhEUBMj (ORCPT ); Thu, 20 May 2021 21:12:39 -0400 Received: from dggems703-chm.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FmT404cGZzqVWP; Fri, 21 May 2021 09:07:44 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems703-chm.china.huawei.com (10.3.19.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 5/6] net: wan: add braces {} to all arms of the statement Date: Fri, 21 May 2021 09:08:16 +0800 Message-ID: <1621559297-9651-6-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> References: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peng Li Braces {} should be used on all arms of this statement. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/hd64572.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index 34acea93efdf..7fccf23c8bef 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -374,8 +374,9 @@ static void sca_set_port(port_t *port) tmc = 1; br = 0; /* For baud=CLOCK_BASE we use tmc=1 br=0 */ brv = 1; - } else if (tmc > 255) + } else if (tmc > 255) { tmc = 256; /* tmc=0 means 256 - low baud rates */ + } port->settings.clock_rate = CLOCK_BASE / brv / tmc; } else { From patchwork Fri May 21 01:08:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 446224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A124C43461 for ; Fri, 21 May 2021 01:11:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C52361353 for ; Fri, 21 May 2021 01:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236278AbhEUBMp (ORCPT ); Thu, 20 May 2021 21:12:45 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5708 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236065AbhEUBMj (ORCPT ); Thu, 20 May 2021 21:12:39 -0400 Received: from dggems705-chm.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FmT405cFczqVWS; Fri, 21 May 2021 09:07:44 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems705-chm.china.huawei.com (10.3.19.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:11:16 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 09:11:15 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 6/6] net: wan: add necessary () to macro argument Date: Fri, 21 May 2021 09:08:17 +0800 Message-ID: <1621559297-9651-7-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> References: <1621559297-9651-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peng Li Macro argument 'card' and 'port' may be better as '(card)' and '(port)' to avoid precedence issues. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/hd64572.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index 7fccf23c8bef..b89b03a6aba7 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c @@ -41,16 +41,16 @@ #define NAPI_WEIGHT 16 -#define get_msci(port) (port->chan ? MSCI1_OFFSET : MSCI0_OFFSET) -#define get_dmac_rx(port) (port->chan ? DMAC1RX_OFFSET : DMAC0RX_OFFSET) -#define get_dmac_tx(port) (port->chan ? DMAC1TX_OFFSET : DMAC0TX_OFFSET) - -#define sca_in(reg, card) readb(card->scabase + (reg)) -#define sca_out(value, reg, card) writeb(value, card->scabase + (reg)) -#define sca_inw(reg, card) readw(card->scabase + (reg)) -#define sca_outw(value, reg, card) writew(value, card->scabase + (reg)) -#define sca_inl(reg, card) readl(card->scabase + (reg)) -#define sca_outl(value, reg, card) writel(value, card->scabase + (reg)) +#define get_msci(port) ((port)->chan ? MSCI1_OFFSET : MSCI0_OFFSET) +#define get_dmac_rx(port) ((port)->chan ? DMAC1RX_OFFSET : DMAC0RX_OFFSET) +#define get_dmac_tx(port) ((port)->chan ? DMAC1TX_OFFSET : DMAC0TX_OFFSET) + +#define sca_in(reg, card) readb((card)->scabase + (reg)) +#define sca_out(value, reg, card) writeb(value, (card)->scabase + (reg)) +#define sca_inw(reg, card) readw((card)->scabase + (reg)) +#define sca_outw(value, reg, card) writew(value, (card)->scabase + (reg)) +#define sca_inl(reg, card) readl((card)->scabase + (reg)) +#define sca_outl(value, reg, card) writel(value, (card)->scabase + (reg)) static int sca_poll(struct napi_struct *napi, int budget);