From patchwork Tue May 25 14:07:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 447819 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 686EEC2B9F8 for ; Tue, 25 May 2021 14:11:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4579B61408 for ; Tue, 25 May 2021 14:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233874AbhEYON0 (ORCPT ); Tue, 25 May 2021 10:13:26 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5702 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233663AbhEYOMd (ORCPT ); Tue, 25 May 2021 10:12:33 -0400 Received: from dggems703-chm.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FqGBb2qtrz1BQtB; Tue, 25 May 2021 22:08:07 +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; Tue, 25 May 2021 22:10:58 +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; Tue, 25 May 2021 22:10:58 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 1/6] net: wan: remove redundant blank lines Date: Tue, 25 May 2021 22:07:53 +0800 Message-ID: <1621951678-23466-2-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> References: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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/n2.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 5bf4463873b1..dd39789ebfa0 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -32,7 +32,6 @@ #include #include "hd64570.h" - static const char* version = "SDL RISCom/N2 driver version: 1.15"; static const char* devname = "RISCom/N2"; @@ -64,11 +63,9 @@ static char *hw; /* pointer to hw=xxx command line string */ #define PCR_ENWIN 4 /* Open window */ #define PCR_BUS16 8 /* 16-bit bus */ - /* Memory Base Address Register */ #define N2_BAR 2 - /* Page Scan Register */ #define N2_PSR 4 #define WIN16K 0x00 @@ -78,7 +75,6 @@ static char *hw; /* pointer to hw=xxx command line string */ #define PSR_DMAEN 0x80 #define PSR_PAGEBITS 0x0F - /* Modem Control Reg */ #define N2_MCR 6 #define CLOCK_OUT_PORT1 0x80 @@ -90,7 +86,6 @@ static char *hw; /* pointer to hw=xxx command line string */ #define DTR_PORT1 0x02 #define DTR_PORT0 0x01 - typedef struct port_s { struct net_device *dev; struct card_s *card; @@ -108,8 +103,6 @@ typedef struct port_s { u8 log_node; /* logical port # */ }port_t; - - typedef struct card_s { u8 __iomem *winbase; /* ISA window base address */ u32 phy_winbase; /* ISA physical base address */ @@ -124,11 +117,9 @@ typedef struct card_s { struct card_s *next_card; }card_t; - static card_t *first_card; static card_t **new_card = &first_card; - #define sca_reg(reg, card) (0x8000 | (card)->io | \ ((reg) & 0x0F) | (((reg) & 0xF0) << 6)) #define sca_in(reg, card) inb(sca_reg(reg, card)) @@ -144,23 +135,19 @@ static card_t **new_card = &first_card; #define get_port(card, port) ((card)->ports[port].valid ? \ &(card)->ports[port] : NULL) - static __inline__ u8 sca_get_page(card_t *card) { return inb(card->io + N2_PSR) & PSR_PAGEBITS; } - static __inline__ void openwin(card_t *card, u8 page) { u8 psr = inb(card->io + N2_PSR); outb((psr & ~PSR_PAGEBITS) | page, card->io + N2_PSR); } - #include "hd64570.c" - static void n2_set_iface(port_t *port) { card_t *card = port->card; @@ -203,8 +190,6 @@ static void n2_set_iface(port_t *port) sca_set_port(port); } - - static int n2_open(struct net_device *dev) { port_t *port = dev_to_port(dev); @@ -226,8 +211,6 @@ static int n2_open(struct net_device *dev) return 0; } - - static int n2_close(struct net_device *dev) { port_t *port = dev_to_port(dev); @@ -241,8 +224,6 @@ static int n2_close(struct net_device *dev) return 0; } - - static int n2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { const size_t size = sizeof(sync_serial_settings); @@ -295,8 +276,6 @@ static int n2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } } - - static void n2_destroy_card(card_t *card) { int cnt; @@ -486,8 +465,6 @@ static int __init n2_run(unsigned long io, unsigned long irq, return 0; } - - static int __init n2_init(void) { if (hw==NULL) { @@ -539,7 +516,6 @@ static int __init n2_init(void) return first_card ? 0 : -EINVAL; } - static void __exit n2_cleanup(void) { card_t *card = first_card; @@ -551,7 +527,6 @@ static void __exit n2_cleanup(void) } } - module_init(n2_init); module_exit(n2_cleanup); From patchwork Tue May 25 14:07:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 447820 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 7D20CC4707F for ; Tue, 25 May 2021 14:11:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 557B561408 for ; Tue, 25 May 2021 14:11:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233814AbhEYONJ (ORCPT ); Tue, 25 May 2021 10:13:09 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6708 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233716AbhEYOMd (ORCPT ); Tue, 25 May 2021 10:12:33 -0400 Received: from dggems705-chm.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FqG9k4GgxzlYM8; Tue, 25 May 2021 22:07:22 +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; Tue, 25 May 2021 22:10:58 +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; Tue, 25 May 2021 22:10:58 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 2/6] net: wan: add blank line after declarations Date: Tue, 25 May 2021 22:07:54 +0800 Message-ID: <1621951678-23466-3-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> References: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 fixes the checkpatch error about missing a blank line after declarations. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/n2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index dd39789ebfa0..5ad8c5032900 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -143,6 +143,7 @@ static __inline__ u8 sca_get_page(card_t *card) static __inline__ void openwin(card_t *card, u8 page) { u8 psr = inb(card->io + N2_PSR); + outb((psr & ~PSR_PAGEBITS) | page, card->io + N2_PSR); } @@ -283,6 +284,7 @@ static void n2_destroy_card(card_t *card) for (cnt = 0; cnt < 2; cnt++) if (card->ports[cnt].card) { struct net_device *dev = port_to_dev(&card->ports[cnt]); + unregister_hdlc_device(dev); } @@ -522,6 +524,7 @@ static void __exit n2_cleanup(void) while (card) { card_t *ptr = card; + card = card->next_card; n2_destroy_card(ptr); } From patchwork Tue May 25 14:07:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 448766 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 391F3C2B9F8 for ; Tue, 25 May 2021 14:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DF146142C for ; Tue, 25 May 2021 14:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233852AbhEYOMt (ORCPT ); Tue, 25 May 2021 10:12:49 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:4005 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233737AbhEYOMc (ORCPT ); Tue, 25 May 2021 10:12:32 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FqGCB4P7tzmbSq; Tue, 25 May 2021 22:08:38 +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; Tue, 25 May 2021 22:10:58 +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; Tue, 25 May 2021 22:10:58 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 3/6] net: wan: fix an code style issue about "foo* bar Date: Tue, 25 May 2021 22:07:55 +0800 Message-ID: <1621951678-23466-4-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> References: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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" and should be "foo *bar". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/n2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 5ad8c5032900..180fb2c9a442 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -32,8 +32,8 @@ #include #include "hd64570.h" -static const char* version = "SDL RISCom/N2 driver version: 1.15"; -static const char* devname = "RISCom/N2"; +static const char *version = "SDL RISCom/N2 driver version: 1.15"; +static const char *devname = "RISCom/N2"; #undef DEBUG_PKT #define DEBUG_RINGS From patchwork Tue May 25 14:07:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 448765 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 1F969C2B9F8 for ; Tue, 25 May 2021 14:11:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F28DD61408 for ; Tue, 25 May 2021 14:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbhEYONQ (ORCPT ); Tue, 25 May 2021 10:13:16 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:4006 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233744AbhEYOMc (ORCPT ); Tue, 25 May 2021 10:12:32 -0400 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FqGCB5WjyzmbTn; Tue, 25 May 2021 22:08:38 +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; Tue, 25 May 2021 22:10:59 +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; Tue, 25 May 2021 22:10:58 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 4/6] net: wan: add some required spaces Date: Tue, 25 May 2021 22:07:56 +0800 Message-ID: <1621951678-23466-5-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> References: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 '(' and '{' Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/n2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 180fb2c9a442..2f602171cbc6 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -101,7 +101,7 @@ typedef struct port_s { u8 rxs, txs, tmc; /* SCA registers */ u8 phy_node; /* physical port # - 0 or 1 */ u8 log_node; /* logical port # */ -}port_t; +} port_t; typedef struct card_s { u8 __iomem *winbase; /* ISA window base address */ @@ -115,7 +115,7 @@ typedef struct card_s { port_t ports[2]; struct card_s *next_card; -}card_t; +} card_t; static card_t *first_card; static card_t **new_card = &first_card; @@ -158,7 +158,7 @@ static void n2_set_iface(port_t *port) u8 rxs = port->rxs & CLK_BRG_MASK; u8 txs = port->txs & CLK_BRG_MASK; - switch(port->settings.clock_type) { + switch (port->settings.clock_type) { case CLOCK_INT: mcr |= port->phy_node ? CLOCK_OUT_PORT1 : CLOCK_OUT_PORT0; rxs |= CLK_BRG_RX; /* BRG output */ @@ -241,7 +241,7 @@ static int n2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) if (cmd != SIOCWANDEV) return hdlc_ioctl(dev, ifr, cmd); - switch(ifr->ifr_settings.type) { + switch (ifr->ifr_settings.type) { case IF_GET_IFACE: ifr->ifr_settings.type = IF_IFACE_SYNC_SERIAL; if (ifr->ifr_settings.size < size) { @@ -253,7 +253,7 @@ static int n2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return 0; case IF_IFACE_SYNC_SERIAL: - if(!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN)) return -EPERM; if (copy_from_user(&new_line, line, size)) @@ -494,7 +494,7 @@ static int __init n2_init(void) if (*hw++ != ',') break; - while(1) { + while (1) { if (*hw == '0' && !valid[0]) valid[0] = 1; /* Port 0 enabled */ else if (*hw == '1' && !valid[1]) @@ -512,7 +512,7 @@ static int __init n2_init(void) if (*hw == '\x0') return first_card ? 0 : -EINVAL; - }while(*hw++ == ':'); + } while (*hw++ == ':'); pr_err("invalid hardware parameters\n"); return first_card ? 0 : -EINVAL; From patchwork Tue May 25 14:07:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 447821 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 AC00AC2B9F8 for ; Tue, 25 May 2021 14:11:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88478613AD for ; Tue, 25 May 2021 14:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233845AbhEYOMq (ORCPT ); Tue, 25 May 2021 10:12:46 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:4007 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233752AbhEYOMc (ORCPT ); Tue, 25 May 2021 10:12:32 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FqGCB6YxnzmbSX; Tue, 25 May 2021 22:08:38 +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; Tue, 25 May 2021 22:10:59 +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; Tue, 25 May 2021 22:10:58 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 5/6] net: wan: replace comparison to NULL with "!card" Date: Tue, 25 May 2021 22:07:57 +0800 Message-ID: <1621951678-23466-6-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> References: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 According to the chackpatch.pl, comparison to NULL could be written "!card". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/n2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 2f602171cbc6..76ef808c2769 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -335,7 +335,7 @@ static int __init n2_run(unsigned long io, unsigned long irq, } card = kzalloc(sizeof(card_t), GFP_KERNEL); - if (card == NULL) + if (!card) return -ENOBUFS; card->ports[0].dev = alloc_hdlcdev(&card->ports[0]); @@ -469,7 +469,7 @@ static int __init n2_run(unsigned long io, unsigned long irq, static int __init n2_init(void) { - if (hw==NULL) { + if (!hw) { #ifdef MODULE pr_info("no card initialized\n"); #endif From patchwork Tue May 25 14:07:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "huangguangbin \(A\)" X-Patchwork-Id: 448767 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 8CE86C47085 for ; Tue, 25 May 2021 14:11:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 738EC613AD for ; Tue, 25 May 2021 14:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233835AbhEYOMo (ORCPT ); Tue, 25 May 2021 10:12:44 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5703 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233754AbhEYOMc (ORCPT ); Tue, 25 May 2021 10:12:32 -0400 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FqGBc1qJrz1BRFT; Tue, 25 May 2021 22:08:08 +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; Tue, 25 May 2021 22:10:59 +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; Tue, 25 May 2021 22:10:59 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 6/6] net: wan: add spaces required around that ':' and '+' Date: Tue, 25 May 2021 22:07:58 +0800 Message-ID: <1621951678-23466-7-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> References: <1621951678-23466-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 adds spaces required around that ':' and '+'. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/n2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c index 76ef808c2769..bdb6dc2409bc 100644 --- a/drivers/net/wan/n2.c +++ b/drivers/net/wan/n2.c @@ -195,7 +195,8 @@ static int n2_open(struct net_device *dev) { port_t *port = dev_to_port(dev); int io = port->card->io; - u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0); + u8 mcr = inb(io + N2_MCR) | + (port->phy_node ? TX422_PORT1 : TX422_PORT0); int result; result = hdlc_open(dev); @@ -216,7 +217,8 @@ static int n2_close(struct net_device *dev) { port_t *port = dev_to_port(dev); int io = port->card->io; - u8 mcr = inb(io+N2_MCR) | (port->phy_node ? TX422_PORT1 : TX422_PORT0); + u8 mcr = inb(io + N2_MCR) | + (port->phy_node ? TX422_PORT1 : TX422_PORT0); sca_close(dev); mcr |= port->phy_node ? DTR_PORT1 : DTR_PORT0; /* set DTR OFF */