Commit 30b8817f authored by David S. Miller's avatar David S. Miller

Merge branch 'net-coding-style'

Weihang Li says:

====================
net: fix some coding style issues

Do some cleanups according to the coding style of kernel, including wrong
print type, redundant and missing spaces and so on.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3cbf7530 44d043b5
...@@ -863,7 +863,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset) ...@@ -863,7 +863,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset)
if (unlikely(i == timeout)) { if (unlikely(i == timeout)) {
netdev_err(ena_dev->net_device, netdev_err(ena_dev->net_device,
"Reading reg failed for timeout. expected: req id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n", "Reading reg failed for timeout. expected: req id[%u] offset[%u] actual: req id[%u] offset[%u]\n",
mmio_read->seq_num, offset, read_resp->req_id, mmio_read->seq_num, offset, read_resp->req_id,
read_resp->reg_off); read_resp->reg_off);
ret = ENA_MMIO_READ_TIMEOUT; ret = ENA_MMIO_READ_TIMEOUT;
...@@ -2396,7 +2396,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev, ...@@ -2396,7 +2396,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev,
if (key) { if (key) {
if (key_len != sizeof(hash_key->key)) { if (key_len != sizeof(hash_key->key)) {
netdev_err(ena_dev->net_device, netdev_err(ena_dev->net_device,
"key len (%hu) doesn't equal the supported size (%zu)\n", "key len (%u) doesn't equal the supported size (%zu)\n",
key_len, sizeof(hash_key->key)); key_len, sizeof(hash_key->key));
return -EINVAL; return -EINVAL;
} }
......
...@@ -3975,7 +3975,7 @@ static u32 ena_calc_max_io_queue_num(struct pci_dev *pdev, ...@@ -3975,7 +3975,7 @@ static u32 ena_calc_max_io_queue_num(struct pci_dev *pdev,
max_num_io_queues = min_t(u32, max_num_io_queues, io_rx_num); max_num_io_queues = min_t(u32, max_num_io_queues, io_rx_num);
max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_sq_num); max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_sq_num);
max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_cq_num); max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_cq_num);
/* 1 IRQ for for mgmnt and 1 IRQs for each IO direction */ /* 1 IRQ for mgmnt and 1 IRQs for each IO direction */
max_num_io_queues = min_t(u32, max_num_io_queues, pci_msix_vec_count(pdev) - 1); max_num_io_queues = min_t(u32, max_num_io_queues, pci_msix_vec_count(pdev) - 1);
if (unlikely(!max_num_io_queues)) { if (unlikely(!max_num_io_queues)) {
dev_err(&pdev->dev, "The device doesn't have io queues\n"); dev_err(&pdev->dev, "The device doesn't have io queues\n");
......
This diff is collapsed.
...@@ -170,6 +170,7 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d) ...@@ -170,6 +170,7 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d)
static void hplance_writerap(void *priv, unsigned short value) static void hplance_writerap(void *priv, unsigned short value)
{ {
struct lance_private *lp = (struct lance_private *)priv; struct lance_private *lp = (struct lance_private *)priv;
do { do {
out_be16(lp->base + HPLANCE_REGOFF + LANCE_RAP, value); out_be16(lp->base + HPLANCE_REGOFF + LANCE_RAP, value);
} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0); } while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
...@@ -178,6 +179,7 @@ static void hplance_writerap(void *priv, unsigned short value) ...@@ -178,6 +179,7 @@ static void hplance_writerap(void *priv, unsigned short value)
static void hplance_writerdp(void *priv, unsigned short value) static void hplance_writerdp(void *priv, unsigned short value)
{ {
struct lance_private *lp = (struct lance_private *)priv; struct lance_private *lp = (struct lance_private *)priv;
do { do {
out_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP, value); out_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP, value);
} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0); } while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
...@@ -187,6 +189,7 @@ static unsigned short hplance_readrdp(void *priv) ...@@ -187,6 +189,7 @@ static unsigned short hplance_readrdp(void *priv)
{ {
struct lance_private *lp = (struct lance_private *)priv; struct lance_private *lp = (struct lance_private *)priv;
__u16 value; __u16 value;
do { do {
value = in_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP); value = in_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP);
} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0); } while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
......
...@@ -484,7 +484,8 @@ void ocelot_adjust_link(struct ocelot *ocelot, int port, ...@@ -484,7 +484,8 @@ void ocelot_adjust_link(struct ocelot *ocelot, int port,
DEV_MAC_ENA_CFG_TX_ENA, DEV_MAC_ENA_CFG); DEV_MAC_ENA_CFG_TX_ENA, DEV_MAC_ENA_CFG);
/* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of /* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of
* reset */ * reset
*/
ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed), ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed),
DEV_CLOCK_CFG); DEV_CLOCK_CFG);
......
...@@ -1044,7 +1044,8 @@ static netdev_tx_t lpc_eth_hard_start_xmit(struct sk_buff *skb, ...@@ -1044,7 +1044,8 @@ static netdev_tx_t lpc_eth_hard_start_xmit(struct sk_buff *skb,
if (pldat->num_used_tx_buffs >= (ENET_TX_DESC - 1)) { if (pldat->num_used_tx_buffs >= (ENET_TX_DESC - 1)) {
/* This function should never be called when there are no /* This function should never be called when there are no
buffers */ * buffers
*/
netif_stop_queue(ndev); netif_stop_queue(ndev);
spin_unlock_irq(&pldat->lock); spin_unlock_irq(&pldat->lock);
WARN(1, "BUG! TX request when no free TX buffers!\n"); WARN(1, "BUG! TX request when no free TX buffers!\n");
...@@ -1318,7 +1319,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) ...@@ -1318,7 +1319,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
pldat->dma_buff_size = PAGE_ALIGN(pldat->dma_buff_size); pldat->dma_buff_size = PAGE_ALIGN(pldat->dma_buff_size);
/* Allocate a chunk of memory for the DMA ethernet buffers /* Allocate a chunk of memory for the DMA ethernet buffers
and descriptors */ * and descriptors
*/
pldat->dma_buff_base_v = pldat->dma_buff_base_v =
dma_alloc_coherent(dev, dma_alloc_coherent(dev,
pldat->dma_buff_size, &dma_handle, pldat->dma_buff_size, &dma_handle,
...@@ -1365,7 +1367,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) ...@@ -1365,7 +1367,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
__lpc_mii_mngt_reset(pldat); __lpc_mii_mngt_reset(pldat);
/* Force default PHY interface setup in chip, this will probably be /* Force default PHY interface setup in chip, this will probably be
changed by the PHY driver */ * changed by the PHY driver
*/
pldat->link = 0; pldat->link = 0;
pldat->speed = 100; pldat->speed = 100;
pldat->duplex = DUPLEX_FULL; pldat->duplex = DUPLEX_FULL;
......
...@@ -146,7 +146,8 @@ spider_net_read_phy(struct net_device *netdev, int mii_id, int reg) ...@@ -146,7 +146,8 @@ spider_net_read_phy(struct net_device *netdev, int mii_id, int reg)
/* we don't use semaphores to wait for an SPIDER_NET_GPROPCMPINT /* we don't use semaphores to wait for an SPIDER_NET_GPROPCMPINT
* interrupt, as we poll for the completion of the read operation * interrupt, as we poll for the completion of the read operation
* in spider_net_read_phy. Should take about 50 us */ * in spider_net_read_phy. Should take about 50 us
*/
do { do {
readvalue = spider_net_read_reg(card, SPIDER_NET_GPCROPCMD); readvalue = spider_net_read_reg(card, SPIDER_NET_GPCROPCMD);
} while (readvalue & SPIDER_NET_GPREXEC); } while (readvalue & SPIDER_NET_GPREXEC);
...@@ -387,7 +388,8 @@ spider_net_prepare_rx_descr(struct spider_net_card *card, ...@@ -387,7 +388,8 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
(~(SPIDER_NET_RXBUF_ALIGN - 1)); (~(SPIDER_NET_RXBUF_ALIGN - 1));
/* and we need to have it 128 byte aligned, therefore we allocate a /* and we need to have it 128 byte aligned, therefore we allocate a
* bit more */ * bit more
*/
/* allocate an skb */ /* allocate an skb */
descr->skb = netdev_alloc_skb(card->netdev, descr->skb = netdev_alloc_skb(card->netdev,
bufsize + SPIDER_NET_RXBUF_ALIGN - 1); bufsize + SPIDER_NET_RXBUF_ALIGN - 1);
...@@ -488,7 +490,8 @@ spider_net_refill_rx_chain(struct spider_net_card *card) ...@@ -488,7 +490,8 @@ spider_net_refill_rx_chain(struct spider_net_card *card)
/* one context doing the refill (and a second context seeing that /* one context doing the refill (and a second context seeing that
* and omitting it) is ok. If called by NAPI, we'll be called again * and omitting it) is ok. If called by NAPI, we'll be called again
* as spider_net_decode_one_descr is called several times. If some * as spider_net_decode_one_descr is called several times. If some
* interrupt calls us, the NAPI is about to clean up anyway. */ * interrupt calls us, the NAPI is about to clean up anyway.
*/
if (!spin_trylock_irqsave(&chain->lock, flags)) if (!spin_trylock_irqsave(&chain->lock, flags))
return; return;
...@@ -523,14 +526,16 @@ spider_net_alloc_rx_skbs(struct spider_net_card *card) ...@@ -523,14 +526,16 @@ spider_net_alloc_rx_skbs(struct spider_net_card *card)
/* Put at least one buffer into the chain. if this fails, /* Put at least one buffer into the chain. if this fails,
* we've got a problem. If not, spider_net_refill_rx_chain * we've got a problem. If not, spider_net_refill_rx_chain
* will do the rest at the end of this function. */ * will do the rest at the end of this function.
*/
if (spider_net_prepare_rx_descr(card, chain->head)) if (spider_net_prepare_rx_descr(card, chain->head))
goto error; goto error;
else else
chain->head = chain->head->next; chain->head = chain->head->next;
/* This will allocate the rest of the rx buffers; /* This will allocate the rest of the rx buffers;
* if not, it's business as usual later on. */ * if not, it's business as usual later on.
*/
spider_net_refill_rx_chain(card); spider_net_refill_rx_chain(card);
spider_net_enable_rxdmac(card); spider_net_enable_rxdmac(card);
return 0; return 0;
...@@ -706,7 +711,8 @@ spider_net_set_low_watermark(struct spider_net_card *card) ...@@ -706,7 +711,8 @@ spider_net_set_low_watermark(struct spider_net_card *card)
int i; int i;
/* Measure the length of the queue. Measurement does not /* Measure the length of the queue. Measurement does not
* need to be precise -- does not need a lock. */ * need to be precise -- does not need a lock.
*/
while (descr != card->tx_chain.head) { while (descr != card->tx_chain.head) {
status = descr->hwdescr->dmac_cmd_status & SPIDER_NET_DESCR_NOT_IN_USE; status = descr->hwdescr->dmac_cmd_status & SPIDER_NET_DESCR_NOT_IN_USE;
if (status == SPIDER_NET_DESCR_NOT_IN_USE) if (status == SPIDER_NET_DESCR_NOT_IN_USE)
...@@ -786,7 +792,8 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal) ...@@ -786,7 +792,8 @@ spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
/* fallthrough, if we release the descriptors /* fallthrough, if we release the descriptors
* brutally (then we don't care about * brutally (then we don't care about
* SPIDER_NET_DESCR_CARDOWNED) */ * SPIDER_NET_DESCR_CARDOWNED)
*/
fallthrough; fallthrough;
case SPIDER_NET_DESCR_RESPONSE_ERROR: case SPIDER_NET_DESCR_RESPONSE_ERROR:
...@@ -948,7 +955,8 @@ spider_net_pass_skb_up(struct spider_net_descr *descr, ...@@ -948,7 +955,8 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
skb_put(skb, hwdescr->valid_size); skb_put(skb, hwdescr->valid_size);
/* the card seems to add 2 bytes of junk in front /* the card seems to add 2 bytes of junk in front
* of the ethernet frame */ * of the ethernet frame
*/
#define SPIDER_MISALIGN 2 #define SPIDER_MISALIGN 2
skb_pull(skb, SPIDER_MISALIGN); skb_pull(skb, SPIDER_MISALIGN);
skb->protocol = eth_type_trans(skb, netdev); skb->protocol = eth_type_trans(skb, netdev);
...@@ -1382,7 +1390,8 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg, ...@@ -1382,7 +1390,8 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg,
/* PHY read operation completed */ /* PHY read operation completed */
/* we don't use semaphores, as we poll for the completion /* we don't use semaphores, as we poll for the completion
* of the read operation in spider_net_read_phy. Should take * of the read operation in spider_net_read_phy. Should take
* about 50 us */ * about 50 us
*/
show_error = 0; show_error = 0;
break; break;
case SPIDER_NET_GPWFFINT: case SPIDER_NET_GPWFFINT:
...@@ -1450,7 +1459,8 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg, ...@@ -1450,7 +1459,8 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg,
{ {
case SPIDER_NET_GTMFLLINT: case SPIDER_NET_GTMFLLINT:
/* TX RAM full may happen on a usual case. /* TX RAM full may happen on a usual case.
* Logging is not needed. */ * Logging is not needed.
*/
show_error = 0; show_error = 0;
break; break;
case SPIDER_NET_GRFDFLLINT: case SPIDER_NET_GRFDFLLINT:
...@@ -1694,7 +1704,8 @@ spider_net_enable_card(struct spider_net_card *card) ...@@ -1694,7 +1704,8 @@ spider_net_enable_card(struct spider_net_card *card)
{ {
int i; int i;
/* the following array consists of (register),(value) pairs /* the following array consists of (register),(value) pairs
* that are set in this function. A register of 0 ends the list */ * that are set in this function. A register of 0 ends the list
*/
u32 regs[][2] = { u32 regs[][2] = {
{ SPIDER_NET_GRESUMINTNUM, 0 }, { SPIDER_NET_GRESUMINTNUM, 0 },
{ SPIDER_NET_GREINTNUM, 0 }, { SPIDER_NET_GREINTNUM, 0 },
...@@ -1757,7 +1768,8 @@ spider_net_enable_card(struct spider_net_card *card) ...@@ -1757,7 +1768,8 @@ spider_net_enable_card(struct spider_net_card *card)
spider_net_write_reg(card, SPIDER_NET_ECMODE, SPIDER_NET_ECMODE_VALUE); spider_net_write_reg(card, SPIDER_NET_ECMODE, SPIDER_NET_ECMODE_VALUE);
/* set chain tail address for RX chains and /* set chain tail address for RX chains and
* enable DMA */ * enable DMA
*/
spider_net_enable_rxchtails(card); spider_net_enable_rxchtails(card);
spider_net_enable_rxdmac(card); spider_net_enable_rxdmac(card);
...@@ -1995,7 +2007,8 @@ static void spider_net_link_phy(struct timer_list *t) ...@@ -1995,7 +2007,8 @@ static void spider_net_link_phy(struct timer_list *t)
case BCM54XX_UNKNOWN: case BCM54XX_UNKNOWN:
/* copper, fiber with and without failed, /* copper, fiber with and without failed,
* retry from beginning */ * retry from beginning
*/
spider_net_setup_aneg(card); spider_net_setup_aneg(card);
card->medium = BCM54XX_COPPER; card->medium = BCM54XX_COPPER;
break; break;
...@@ -2263,7 +2276,8 @@ spider_net_setup_netdev(struct spider_net_card *card) ...@@ -2263,7 +2276,8 @@ spider_net_setup_netdev(struct spider_net_card *card)
netdev->features |= NETIF_F_RXCSUM; netdev->features |= NETIF_F_RXCSUM;
netdev->features |= NETIF_F_IP_CSUM | NETIF_F_LLTX; netdev->features |= NETIF_F_IP_CSUM | NETIF_F_LLTX;
/* some time: NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | /* some time: NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
* NETIF_F_HW_VLAN_CTAG_FILTER */ * NETIF_F_HW_VLAN_CTAG_FILTER
*/
/* MTU range: 64 - 2294 */ /* MTU range: 64 - 2294 */
netdev->min_mtu = SPIDER_NET_MIN_MTU; netdev->min_mtu = SPIDER_NET_MIN_MTU;
......
...@@ -1914,7 +1914,8 @@ tc35815_set_multicast_list(struct net_device *dev) ...@@ -1914,7 +1914,8 @@ tc35815_set_multicast_list(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
/* With some (all?) 100MHalf HUB, controller will hang /* With some (all?) 100MHalf HUB, controller will hang
* if we enabled promiscuous mode before linkup... */ * if we enabled promiscuous mode before linkup...
*/
struct tc35815_local *lp = netdev_priv(dev); struct tc35815_local *lp = netdev_priv(dev);
if (!lp->link) if (!lp->link)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment