[PATCH 2/5] net: ethernet: altera: fix indentation warnings

From: deepakx.nagaraju
Date: Wed Dec 13 2023 - 02:18:53 EST


From: Nagaraju DeepakX <deepakx.nagaraju@xxxxxxxxx>

Fix indentation issues such as missing a blank line after declarations
and alignment issues.

Signed-off-by: Nagaraju DeepakX <deepakx.nagaraju@xxxxxxxxx>
Reviewed-by: Andy Schevchenko <andriy.schevchenko@xxxxxxxxxxxxxxx>
---
drivers/net/ethernet/altera/altera_sgdma.c | 22 +++++++++----------
drivers/net/ethernet/altera/altera_tse_main.c | 9 +++-----
2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/altera/altera_sgdma.c b/drivers/net/ethernet/altera/altera_sgdma.c
index 5517f89f1ef9..d4edfb3e09e8 100644
--- a/drivers/net/ethernet/altera/altera_sgdma.c
+++ b/drivers/net/ethernet/altera/altera_sgdma.c
@@ -20,7 +20,7 @@ static void sgdma_setup_descrip(struct sgdma_descrip __iomem *desc,
int wfixed);

static int sgdma_async_write(struct altera_tse_private *priv,
- struct sgdma_descrip __iomem *desc);
+ struct sgdma_descrip __iomem *desc);

static int sgdma_async_read(struct altera_tse_private *priv);

@@ -63,7 +63,6 @@ int sgdma_initialize(struct altera_tse_private *priv)
INIT_LIST_HEAD(&priv->txlisthd);
INIT_LIST_HEAD(&priv->rxlisthd);

-
priv->rxdescphys = dma_map_single(priv->device,
(void __force *)priv->rx_dma_desc,
priv->rxdescmem, DMA_BIDIRECTIONAL);
@@ -192,9 +191,7 @@ int sgdma_tx_buffer(struct altera_tse_private *priv, struct tse_buffer *buffer)
return 1;
}

-
-/* tx_lock held to protect access to queued tx list
- */
+/* tx_lock held to protect access to queued tx list */
u32 sgdma_tx_completions(struct altera_tse_private *priv)
{
u32 ready = 0;
@@ -237,10 +234,9 @@ u32 sgdma_rx_status(struct altera_tse_private *priv)
if (sts & SGDMA_STSREG_EOP) {
unsigned int pktlength;
unsigned int pktstatus;
- dma_sync_single_for_cpu(priv->device,
- priv->rxdescphys,
- SGDMA_DESC_LEN,
- DMA_FROM_DEVICE);
+
+ dma_sync_single_for_cpu(priv->device, priv->rxdescphys,
+ SGDMA_DESC_LEN, DMA_FROM_DEVICE);

pktlength = csrrd16(desc, sgdma_descroffs(bytes_xferred));
pktstatus = csrrd8(desc, sgdma_descroffs(status));
@@ -286,7 +282,6 @@ u32 sgdma_rx_status(struct altera_tse_private *priv)
return rxstatus;
}

-
/* Private functions */
static void sgdma_setup_descrip(struct sgdma_descrip __iomem *desc,
struct sgdma_descrip __iomem *ndesc,
@@ -301,6 +296,7 @@ static void sgdma_setup_descrip(struct sgdma_descrip __iomem *desc,
/* Clear the next descriptor as not owned by hardware */

u32 ctrl = csrrd8(ndesc, sgdma_descroffs(control));
+
ctrl &= ~SGDMA_CONTROL_HW_OWNED;
csrwr8(ctrl, ndesc, sgdma_descroffs(control));

@@ -406,6 +402,7 @@ sgdma_txphysaddr(struct altera_tse_private *priv,
{
dma_addr_t paddr = priv->txdescmem_busaddr;
uintptr_t offs = (uintptr_t)desc - (uintptr_t)priv->tx_dma_desc;
+
return (dma_addr_t)((uintptr_t)paddr + offs);
}

@@ -415,6 +412,7 @@ sgdma_rxphysaddr(struct altera_tse_private *priv,
{
dma_addr_t paddr = priv->rxdescmem_busaddr;
uintptr_t offs = (uintptr_t)desc - (uintptr_t)priv->rx_dma_desc;
+
return (dma_addr_t)((uintptr_t)paddr + offs);
}

@@ -445,7 +443,6 @@ queue_tx(struct altera_tse_private *priv, struct tse_buffer *buffer)
list_add_tail(&buffer->lh, &priv->txlisthd);
}

-
/* adds a tse_buffer to the tail of a rx buffer list
* assumes the caller is managing and holding a mutual exclusion
* primitive to avoid simultaneous pushes/pops to the list.
@@ -465,6 +462,7 @@ static struct tse_buffer *
dequeue_tx(struct altera_tse_private *priv)
{
struct tse_buffer *buffer = NULL;
+
list_remove_head(&priv->txlisthd, buffer, struct tse_buffer, lh);
return buffer;
}
@@ -478,6 +476,7 @@ static struct tse_buffer *
dequeue_rx(struct altera_tse_private *priv)
{
struct tse_buffer *buffer = NULL;
+
list_remove_head(&priv->rxlisthd, buffer, struct tse_buffer, lh);
return buffer;
}
@@ -492,6 +491,7 @@ static struct tse_buffer *
queue_rx_peekhead(struct altera_tse_private *priv)
{
struct tse_buffer *buffer = NULL;
+
list_peek_head(&priv->rxlisthd, buffer, struct tse_buffer, lh);
return buffer;
}
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 1c8763be0e4b..6a1a004ea693 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -258,14 +258,12 @@ static int alloc_init_skbufs(struct altera_tse_private *priv)
int i;

/* Create Rx ring buffer */
- priv->rx_ring = kcalloc(rx_descs, sizeof(struct tse_buffer),
- GFP_KERNEL);
+ priv->rx_ring = kcalloc(rx_descs, sizeof(struct tse_buffer), GFP_KERNEL);
if (!priv->rx_ring)
goto err_rx_ring;

/* Create Tx ring buffer */
- priv->tx_ring = kcalloc(tx_descs, sizeof(struct tse_buffer),
- GFP_KERNEL);
+ priv->tx_ring = kcalloc(tx_descs, sizeof(struct tse_buffer), GFP_KERNEL);
if (!priv->tx_ring)
goto err_tx_ring;

@@ -319,8 +317,7 @@ static inline void tse_rx_refill(struct altera_tse_private *priv)
unsigned int entry;
int ret;

- for (; priv->rx_cons - priv->rx_prod > 0;
- priv->rx_prod++) {
+ for (; priv->rx_cons - priv->rx_prod > 0; priv->rx_prod++) {
entry = priv->rx_prod % rxsize;
if (likely(priv->rx_ring[entry].skb == NULL)) {
ret = tse_init_rx_buffer(priv, &priv->rx_ring[entry],
--
2.26.2