From 8890d0a1891aea989e23e357eac4c8a206152d58 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:08 +0800 Subject: net: wan: remove redundant blank lines This patch removes some redundant blank lines. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index f393684f203a..676dd813d36d 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -50,7 +50,6 @@ static const char* version = "wanXL serial card driver version: 0.48"; /* MAILBOX #2 - DRAM SIZE */ #define MBX2_MEMSZ_MASK 0xFFFF0000 /* PUTS Memory Size Register mask */ - struct port { struct net_device *dev; struct card *card; @@ -61,13 +60,11 @@ struct port { struct sk_buff *tx_skbs[TX_BUFFERS]; }; - struct card_status { desc_t rx_descs[RX_QUEUE_LENGTH]; port_status_t port_status[4]; }; - struct card { int n_ports; /* 1, 2 or 4 ports */ u8 irq; @@ -81,20 +78,16 @@ struct card { struct port ports[]; /* 1 - 4 port structures follow */ }; - - static inline struct port *dev_to_port(struct net_device *dev) { return (struct port *)dev_to_hdlc(dev)->priv; } - static inline port_status_t *get_status(struct port *port) { return &port->card->status->port_status[port->node]; } - #ifdef DEBUG_PCI static inline dma_addr_t pci_map_single_debug(struct pci_dev *pdev, void *ptr, size_t size, int direction) @@ -110,7 +103,6 @@ static inline dma_addr_t pci_map_single_debug(struct pci_dev *pdev, void *ptr, #define pci_map_single pci_map_single_debug #endif - /* Cable and/or personality module change interrupt service */ static inline void wanxl_cable_intr(struct port *port) { @@ -154,8 +146,6 @@ static inline void wanxl_cable_intr(struct port *port) netif_carrier_off(port->dev); } - - /* Transmit complete interrupt service */ static inline void wanxl_tx_intr(struct port *port) { @@ -187,8 +177,6 @@ static inline void wanxl_tx_intr(struct port *port) } } - - /* Receive complete interrupt service */ static inline void wanxl_rx_intr(struct card *card) { @@ -239,8 +227,6 @@ static inline void wanxl_rx_intr(struct card *card) } } - - static irqreturn_t wanxl_intr(int irq, void* dev_id) { struct card *card = dev_id; @@ -248,7 +234,6 @@ static irqreturn_t wanxl_intr(int irq, void* dev_id) u32 stat; int handled = 0; - while((stat = readl(card->plx + PLX_DOORBELL_FROM_CARD)) != 0) { handled = 1; writel(stat, card->plx + PLX_DOORBELL_FROM_CARD); @@ -266,8 +251,6 @@ static irqreturn_t wanxl_intr(int irq, void* dev_id) return IRQ_RETVAL(handled); } - - static netdev_tx_t wanxl_xmit(struct sk_buff *skb, struct net_device *dev) { struct port *port = dev_to_port(dev); @@ -312,8 +295,6 @@ static netdev_tx_t wanxl_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_OK; } - - static int wanxl_attach(struct net_device *dev, unsigned short encoding, unsigned short parity) { @@ -335,8 +316,6 @@ static int wanxl_attach(struct net_device *dev, unsigned short encoding, return 0; } - - static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { const size_t size = sizeof(sync_serial_settings); @@ -387,8 +366,6 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } } - - static int wanxl_open(struct net_device *dev) { struct port *port = dev_to_port(dev); @@ -423,8 +400,6 @@ static int wanxl_open(struct net_device *dev) return -EFAULT; } - - static int wanxl_close(struct net_device *dev) { struct port *port = dev_to_port(dev); @@ -461,8 +436,6 @@ static int wanxl_close(struct net_device *dev) return 0; } - - static struct net_device_stats *wanxl_get_stats(struct net_device *dev) { struct port *port = dev_to_port(dev); @@ -474,8 +447,6 @@ static struct net_device_stats *wanxl_get_stats(struct net_device *dev) return &dev->stats; } - - static int wanxl_puts_command(struct card *card, u32 cmd) { unsigned long timeout = jiffies + 5 * HZ; @@ -491,8 +462,6 @@ static int wanxl_puts_command(struct card *card, u32 cmd) return -1; } - - static void wanxl_reset(struct card *card) { u32 old_value = readl(card->plx + PLX_CONTROL) & ~PLX_CTL_RESET; @@ -505,8 +474,6 @@ static void wanxl_reset(struct card *card) readl(card->plx + PLX_CONTROL); /* wait for posted write */ } - - static void wanxl_pci_remove_one(struct pci_dev *pdev) { struct card *card = pci_get_drvdata(pdev); @@ -543,7 +510,6 @@ static void wanxl_pci_remove_one(struct pci_dev *pdev) kfree(card); } - #include "wanxlfw.inc" static const struct net_device_ops wanxl_ops = { @@ -677,7 +643,6 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, /* set up on-board RAM mapping */ mem_phy = pci_resource_start(pdev, 2); - /* sanity check the board's reported memory size */ if (ramsize < BUFFERS_ADDR + (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) { @@ -813,7 +778,6 @@ static const struct pci_device_id wanxl_pci_tbl[] = { { 0, } }; - static struct pci_driver wanxl_pci_driver = { .name = "wanXL", .id_table = wanxl_pci_tbl, @@ -821,7 +785,6 @@ static struct pci_driver wanxl_pci_driver = { .remove = wanxl_pci_remove_one, }; - static int __init wanxl_init_module(void) { #ifdef MODULE @@ -835,7 +798,6 @@ static void __exit wanxl_cleanup_module(void) pci_unregister_driver(&wanxl_pci_driver); } - MODULE_AUTHOR("Krzysztof Halasa "); MODULE_DESCRIPTION("SBE Inc. wanXL serial port driver"); MODULE_LICENSE("GPL v2"); -- cgit v1.2.3-59-g8ed1b From b32db030b96e380a86b0d8827a902bdf41f7035a Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:09 +0800 Subject: net: wan: fix an code style issue about "foo* bar" Fix the checkpatch error as "foo* bar" and should be "foo *bar", and "(foo*)" should be "(foo *)". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 676dd813d36d..afca54cf3e82 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -32,7 +32,7 @@ #include "wanxl.h" -static const char* version = "wanXL serial card driver version: 0.48"; +static const char *version = "wanXL serial card driver version: 0.48"; #define PLX_CTL_RESET 0x40000000 /* adapter reset */ @@ -227,7 +227,7 @@ static inline void wanxl_rx_intr(struct card *card) } } -static irqreturn_t wanxl_intr(int irq, void* dev_id) +static irqreturn_t wanxl_intr(int irq, void *dev_id) { struct card *card = dev_id; int i; @@ -677,7 +677,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, } for (i = 0; i < sizeof(firmware); i += 4) - writel(ntohl(*(__be32*)(firmware + i)), mem + PDM_OFFSET + i); + writel(ntohl(*(__be32 *)(firmware + i)), mem + PDM_OFFSET + i); for (i = 0; i < ports; i++) writel(card->status_address + -- cgit v1.2.3-59-g8ed1b From f0328a1922906be3540611e344914b9682fff350 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:10 +0800 Subject: net: wan: add blank line after declarations This patch fixes the checkpatch error about missing a blank line after declarations. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index afca54cf3e82..566c519c6f65 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -93,6 +93,7 @@ static inline dma_addr_t pci_map_single_debug(struct pci_dev *pdev, void *ptr, size_t size, int direction) { dma_addr_t addr = dma_map_single(&pdev->dev, ptr, size, direction); + if (addr + size > 0x100000000LL) pr_crit("%s: pci_map_single() returned memory at 0x%llx!\n", pci_name(pdev), (unsigned long long)addr); @@ -150,6 +151,7 @@ static inline void wanxl_cable_intr(struct port *port) static inline void wanxl_tx_intr(struct port *port) { struct net_device *dev = port->dev; + while (1) { desc_t *desc = &get_status(port)->tx_descs[port->tx_in]; struct sk_buff *skb = port->tx_skbs[port->tx_in]; @@ -181,6 +183,7 @@ static inline void wanxl_tx_intr(struct port *port) static inline void wanxl_rx_intr(struct card *card) { desc_t *desc; + while (desc = &card->status->rx_descs[card->rx_in], desc->stat != PACKET_EMPTY) { if ((desc->stat & PACKET_PORT_MASK) > card->n_ports) @@ -662,6 +665,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, for (i = 0; i < RX_QUEUE_LENGTH; i++) { struct sk_buff *skb = dev_alloc_skb(BUFFER_LENGTH); + card->rx_skbs[i] = skb; if (skb) card->status->rx_descs[i].address = @@ -729,6 +733,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, hdlc_device *hdlc; struct port *port = &card->ports[i]; struct net_device *dev = alloc_hdlcdev(port); + if (!dev) { pr_err("%s: unable to allocate memory\n", pci_name(pdev)); -- cgit v1.2.3-59-g8ed1b From 261795f4113bba9b26e76b27c0522c403d90bfe7 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:11 +0800 Subject: net: wan: code indent use tabs where possible Code indent should use tabs where possible. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 566c519c6f65..0bcb21ddcc62 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -54,7 +54,7 @@ struct port { struct net_device *dev; struct card *card; spinlock_t lock; /* for wanxl_xmit */ - int node; /* physical port #0 - 3 */ + int node; /* physical port #0 - 3 */ unsigned int clock_type; int tx_in, tx_out; struct sk_buff *tx_skbs[TX_BUFFERS]; @@ -153,7 +153,7 @@ static inline void wanxl_tx_intr(struct port *port) struct net_device *dev = port->dev; while (1) { - desc_t *desc = &get_status(port)->tx_descs[port->tx_in]; + desc_t *desc = &get_status(port)->tx_descs[port->tx_in]; struct sk_buff *skb = port->tx_skbs[port->tx_in]; switch (desc->stat) { @@ -171,12 +171,12 @@ static inline void wanxl_tx_intr(struct port *port) dev->stats.tx_packets++; dev->stats.tx_bytes += skb->len; } - desc->stat = PACKET_EMPTY; /* Free descriptor */ + desc->stat = PACKET_EMPTY; /* Free descriptor */ dma_unmap_single(&port->card->pdev->dev, desc->address, skb->len, DMA_TO_DEVICE); dev_consume_skb_irq(skb); - port->tx_in = (port->tx_in + 1) % TX_BUFFERS; - } + port->tx_in = (port->tx_in + 1) % TX_BUFFERS; + } } /* Receive complete interrupt service */ @@ -233,15 +233,15 @@ static inline void wanxl_rx_intr(struct card *card) static irqreturn_t wanxl_intr(int irq, void *dev_id) { struct card *card = dev_id; - int i; - u32 stat; - int handled = 0; + int i; + u32 stat; + int handled = 0; - while((stat = readl(card->plx + PLX_DOORBELL_FROM_CARD)) != 0) { - handled = 1; + while ((stat = readl(card->plx + PLX_DOORBELL_FROM_CARD)) != 0) { + handled = 1; writel(stat, card->plx + PLX_DOORBELL_FROM_CARD); - for (i = 0; i < card->n_ports; i++) { + for (i = 0; i < card->n_ports; i++) { if (stat & (1 << (DOORBELL_FROM_CARD_TX_0 + i))) wanxl_tx_intr(&card->ports[i]); if (stat & (1 << (DOORBELL_FROM_CARD_CABLE_0 + i))) @@ -249,9 +249,9 @@ static irqreturn_t wanxl_intr(int irq, void *dev_id) } if (stat & (1 << DOORBELL_FROM_CARD_RX)) wanxl_rx_intr(card); - } + } - return IRQ_RETVAL(handled); + return IRQ_RETVAL(handled); } static netdev_tx_t wanxl_xmit(struct sk_buff *skb, struct net_device *dev) @@ -259,11 +259,11 @@ static netdev_tx_t wanxl_xmit(struct sk_buff *skb, struct net_device *dev) struct port *port = dev_to_port(dev); desc_t *desc; - spin_lock(&port->lock); + spin_lock(&port->lock); desc = &get_status(port)->tx_descs[port->tx_out]; - if (desc->stat != PACKET_EMPTY) { - /* should never happen - previous xmit should stop queue */ + if (desc->stat != PACKET_EMPTY) { + /* should never happen - previous xmit should stop queue */ #ifdef DEBUG_PKT printk(KERN_DEBUG "%s: transmitter buffer full\n", dev->name); #endif @@ -366,7 +366,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) default: return hdlc_ioctl(dev, ifr, cmd); - } + } } static int wanxl_open(struct net_device *dev) -- cgit v1.2.3-59-g8ed1b From e5877104b5ec315167e0234110725f6a7c8351ab Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:12 +0800 Subject: net: wan: fix the code style issue about trailing statements Trailing statements should be on next line. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 59 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 0bcb21ddcc62..7e5bf207a142 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -112,21 +112,45 @@ static inline void wanxl_cable_intr(struct port *port) const char *cable, *pm, *dte = "", *dsr = "", *dcd = ""; switch(value & 0x7) { - case STATUS_CABLE_V35: cable = "V.35"; break; - case STATUS_CABLE_X21: cable = "X.21"; break; - case STATUS_CABLE_V24: cable = "V.24"; break; - case STATUS_CABLE_EIA530: cable = "EIA530"; break; - case STATUS_CABLE_NONE: cable = "no"; break; - default: cable = "invalid"; + case STATUS_CABLE_V35: + cable = "V.35"; + break; + case STATUS_CABLE_X21: + cable = "X.21"; + break; + case STATUS_CABLE_V24: + cable = "V.24"; + break; + case STATUS_CABLE_EIA530: + cable = "EIA530"; + break; + case STATUS_CABLE_NONE: + cable = "no"; + break; + default: + cable = "invalid"; } switch((value >> STATUS_CABLE_PM_SHIFT) & 0x7) { - case STATUS_CABLE_V35: pm = "V.35"; break; - case STATUS_CABLE_X21: pm = "X.21"; break; - case STATUS_CABLE_V24: pm = "V.24"; break; - case STATUS_CABLE_EIA530: pm = "EIA530"; break; - case STATUS_CABLE_NONE: pm = "no personality"; valid = 0; break; - default: pm = "invalid personality"; valid = 0; + case STATUS_CABLE_V35: + pm = "V.35"; + break; + case STATUS_CABLE_X21: + pm = "X.21"; + break; + case STATUS_CABLE_V24: + pm = "V.24"; + break; + case STATUS_CABLE_EIA530: + pm = "EIA530"; + break; + case STATUS_CABLE_NONE: + pm = "no personality"; + valid = 0; + break; + default: + pm = "invalid personality"; + valid = 0; } if (valid) { @@ -563,9 +587,14 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, } switch (pdev->device) { - case PCI_DEVICE_ID_SBE_WANXL100: ports = 1; break; - case PCI_DEVICE_ID_SBE_WANXL200: ports = 2; break; - default: ports = 4; + case PCI_DEVICE_ID_SBE_WANXL100: + ports = 1; + break; + case PCI_DEVICE_ID_SBE_WANXL200: + ports = 2; + break; + default: + ports = 4; } card = kzalloc(struct_size(card, ports, ports), GFP_KERNEL); -- cgit v1.2.3-59-g8ed1b From c3b6b5c64f394ce381ae7ce12060dd61768d9dd7 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:13 +0800 Subject: net: wan: add some required spaces Add space required after that close brace '}'. Add space required before the open parenthesis '('. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 7e5bf207a142..7965c648f3eb 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -111,7 +111,7 @@ static inline void wanxl_cable_intr(struct port *port) int valid = 1; const char *cable, *pm, *dte = "", *dsr = "", *dcd = ""; - switch(value & 0x7) { + switch (value & 0x7) { case STATUS_CABLE_V35: cable = "V.35"; break; @@ -131,7 +131,7 @@ static inline void wanxl_cable_intr(struct port *port) cable = "invalid"; } - switch((value >> STATUS_CABLE_PM_SHIFT) & 0x7) { + switch ((value >> STATUS_CABLE_PM_SHIFT) & 0x7) { case STATUS_CABLE_V35: pm = "V.35"; break; @@ -484,7 +484,7 @@ static int wanxl_puts_command(struct card *card, u32 cmd) return 0; schedule(); - }while (time_after(timeout, jiffies)); + } while (time_after(timeout, jiffies)); return -1; } @@ -654,7 +654,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, return -ENODEV; } - switch(stat & 0xC0) { + switch (stat & 0xC0) { case 0x00: /* hmm - PUTS completed with non-zero code? */ case 0x80: /* PUTS still testing the hardware */ break; @@ -733,7 +733,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, if ((stat = readl(card->plx + PLX_MAILBOX_5)) != 0) break; schedule(); - }while (time_after(timeout, jiffies)); + } while (time_after(timeout, jiffies)); if (!stat) { pr_warn("%s: timeout while initializing card firmware\n", -- cgit v1.2.3-59-g8ed1b From 87feef1cfbbe9233c53d5c4ff03277b70b58c458 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:14 +0800 Subject: net: wan: move out assignment in if condition Should not use assignment in if condition. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 7965c648f3eb..a5f0aae30e0c 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -404,7 +404,9 @@ static int wanxl_open(struct net_device *dev) netdev_err(dev, "port already open\n"); return -EIO; } - if ((i = hdlc_open(dev)) != 0) + + i = hdlc_open(dev); + if (i) return i; port->tx_in = port->tx_out = 0; @@ -730,7 +732,8 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, timeout = jiffies + 5 * HZ; do { - if ((stat = readl(card->plx + PLX_MAILBOX_5)) != 0) + stat = readl(card->plx + PLX_MAILBOX_5); + if (stat) break; schedule(); } while (time_after(timeout, jiffies)); -- cgit v1.2.3-59-g8ed1b From 336d781bd952beb1a043b786ced65883d67c34bd Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:15 +0800 Subject: net: wan: replace comparison to NULL with "!card" According to the chackpatch.pl, comparison to NULL could be written "!card". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index a5f0aae30e0c..5a89b6d4d92e 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -600,7 +600,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, } card = kzalloc(struct_size(card, ports, ports), GFP_KERNEL); - if (card == NULL) { + if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); return -ENOBUFS; @@ -612,7 +612,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, card->status = dma_alloc_coherent(&pdev->dev, sizeof(struct card_status), &card->status_address, GFP_KERNEL); - if (card->status == NULL) { + if (!card->status) { wanxl_pci_remove_one(pdev); return -ENOBUFS; } -- cgit v1.2.3-59-g8ed1b From 80d67b95d1fe3aa629efb453f57dea935e304421 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:16 +0800 Subject: net: wan: fix the comments style issue Block comments use * on subsequent lines. Block comments use a trailing */ on a separate line. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 5a89b6d4d92e..18de5f1bb0ed 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -569,12 +569,14 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, return i; /* QUICC can only access first 256 MB of host RAM directly, - but PLX9060 DMA does 32-bits for actual packet data transfers */ + * but PLX9060 DMA does 32-bits for actual packet data transfers + */ /* FIXME when PCI/DMA subsystems are fixed. - We set both dma_mask and consistent_dma_mask to 28 bits - and pray pci_alloc_consistent() will use this info. It should - work on most platforms */ + * We set both dma_mask and consistent_dma_mask to 28 bits + * and pray pci_alloc_consistent() will use this info. It should + * work on most platforms + */ if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(28)) || dma_set_mask(&pdev->dev, DMA_BIT_MASK(28))) { pr_err("No usable DMA configuration\n"); @@ -624,8 +626,9 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, #endif /* FIXME when PCI/DMA subsystems are fixed. - We set both dma_mask and consistent_dma_mask back to 32 bits - to indicate the card can do 32-bit DMA addressing */ + * We set both dma_mask and consistent_dma_mask back to 32 bits + * to indicate the card can do 32-bit DMA addressing + */ if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)) || dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { pr_err("No usable DMA configuration\n"); -- cgit v1.2.3-59-g8ed1b From d1406175f96869b653ee1071266a78cb8c70ab80 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 24 May 2021 22:47:17 +0800 Subject: net: wan: add braces {} to all arms of the statement Braces {} should be used on all arms of this statement. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- drivers/net/wan/wanxl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 18de5f1bb0ed..f22e48415e6f 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -210,18 +210,18 @@ static inline void wanxl_rx_intr(struct card *card) while (desc = &card->status->rx_descs[card->rx_in], desc->stat != PACKET_EMPTY) { - if ((desc->stat & PACKET_PORT_MASK) > card->n_ports) + if ((desc->stat & PACKET_PORT_MASK) > card->n_ports) { pr_crit("%s: received packet for nonexistent port\n", pci_name(card->pdev)); - else { + } else { struct sk_buff *skb = card->rx_skbs[card->rx_in]; struct port *port = &card->ports[desc->stat & PACKET_PORT_MASK]; struct net_device *dev = port->dev; - if (!skb) + if (!skb) { dev->stats.rx_dropped++; - else { + } else { dma_unmap_single(&card->pdev->dev, desc->address, BUFFER_LENGTH, DMA_FROM_DEVICE); -- cgit v1.2.3-59-g8ed1b