Skip to content

Commit

Permalink
Merge branch 'moxa-Fix-style-issues'
Browse files Browse the repository at this point in the history
SZ Lin says:

====================
net: moxa: Fix style issues

This patch set fixs the WARNINGs found by the checkpatch.pl tool
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 29, 2017
2 parents eace92e + dd4de07 commit e9e3807
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions drivers/net/ethernet/moxa/moxart_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void moxart_mac_setup_desc_ring(struct net_device *ndev)

priv->rx_head = 0;

/* reset the MAC controller TX/RX desciptor base address */
/* reset the MAC controller TX/RX descriptor base address */
writel(priv->tx_base, priv->base + REG_TXR_BASE_ADDRESS);
writel(priv->rx_base, priv->base + REG_RXR_BASE_ADDRESS);
}
Expand Down Expand Up @@ -269,9 +269,8 @@ static int moxart_rx_poll(struct napi_struct *napi, int budget)
priv->rx_head = rx_head;
}

if (rx < budget) {
if (rx < budget)
napi_complete_done(napi, rx);
}

priv->reg_imr |= RPKT_FINISH_M;
writel(priv->reg_imr, priv->base + REG_INTERRUPT_MASK);
Expand All @@ -289,8 +288,8 @@ static int moxart_tx_queue_space(struct net_device *ndev)
static void moxart_tx_finished(struct net_device *ndev)
{
struct moxart_mac_priv_t *priv = netdev_priv(ndev);
unsigned tx_head = priv->tx_head;
unsigned tx_tail = priv->tx_tail;
unsigned int tx_head = priv->tx_head;
unsigned int tx_tail = priv->tx_tail;

while (tx_tail != tx_head) {
dma_unmap_single(&ndev->dev, priv->tx_mapping[tx_tail],
Expand All @@ -312,7 +311,7 @@ static void moxart_tx_finished(struct net_device *ndev)

static irqreturn_t moxart_mac_interrupt(int irq, void *dev_id)
{
struct net_device *ndev = (struct net_device *) dev_id;
struct net_device *ndev = (struct net_device *)dev_id;
struct moxart_mac_priv_t *priv = netdev_priv(ndev);
unsigned int ists = readl(priv->base + REG_INTERRUPT_STATUS);

Expand Down Expand Up @@ -495,15 +494,15 @@ static int moxart_mac_probe(struct platform_device *pdev)
priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE *
TX_DESC_NUM, &priv->tx_base,
GFP_DMA | GFP_KERNEL);
if (priv->tx_desc_base == NULL) {
if (!priv->tx_desc_base) {
ret = -ENOMEM;
goto init_fail;
}

priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE *
RX_DESC_NUM, &priv->rx_base,
GFP_DMA | GFP_KERNEL);
if (priv->rx_desc_base == NULL) {
if (!priv->rx_desc_base) {
ret = -ENOMEM;
goto init_fail;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/moxa/moxart_ether.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@
#define RX_DESC2_ADDRESS_VIRT 4

#define TX_DESC_NUM 64
#define TX_DESC_NUM_MASK (TX_DESC_NUM-1)
#define TX_DESC_NUM_MASK (TX_DESC_NUM - 1)
#define TX_NEXT(N) (((N) + 1) & (TX_DESC_NUM_MASK))
#define TX_BUF_SIZE 1600
#define TX_BUF_SIZE_MAX (TX_DESC1_BUF_SIZE_MASK+1)
#define TX_BUF_SIZE_MAX (TX_DESC1_BUF_SIZE_MASK + 1)
#define TX_WAKE_THRESHOLD 16

#define RX_DESC_NUM 64
#define RX_DESC_NUM_MASK (RX_DESC_NUM-1)
#define RX_DESC_NUM_MASK (RX_DESC_NUM - 1)
#define RX_NEXT(N) (((N) + 1) & (RX_DESC_NUM_MASK))
#define RX_BUF_SIZE 1600
#define RX_BUF_SIZE_MAX (RX_DESC1_BUF_SIZE_MASK+1)
#define RX_BUF_SIZE_MAX (RX_DESC1_BUF_SIZE_MASK + 1)

#define REG_INTERRUPT_STATUS 0
#define REG_INTERRUPT_MASK 4
Expand Down

0 comments on commit e9e3807

Please sign in to comment.