All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis
@ 2021-12-29 23:39 Aleksander Jan Bajkowski
  2021-12-30  1:32 ` Joe Perches
  2021-12-30 13:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Aleksander Jan Bajkowski @ 2021-12-29 23:39 UTC (permalink / raw)
  To: davem, kuba, olek2, jgg, rdunlap, arnd, netdev, linux-kernel

checkpatch.pl complains as the following:

Alignment should match open parenthesis

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
 drivers/net/ethernet/lantiq_etop.c | 34 +++++++++++++++---------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 072391c494ce..f0fbce3eb45b 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -111,9 +111,9 @@ ltq_etop_alloc_skb(struct ltq_etop_chan *ch)
 	ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN);
 	if (!ch->skb[ch->dma.desc])
 		return -ENOMEM;
-	ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(&priv->pdev->dev,
-		ch->skb[ch->dma.desc]->data, MAX_DMA_DATA_LEN,
-		DMA_FROM_DEVICE);
+	ch->dma.desc_base[ch->dma.desc].addr =
+		dma_map_single(&priv->pdev->dev, ch->skb[ch->dma.desc]->data,
+			       MAX_DMA_DATA_LEN, DMA_FROM_DEVICE);
 	ch->dma.desc_base[ch->dma.desc].addr =
 		CPHYSADDR(ch->skb[ch->dma.desc]->data);
 	ch->dma.desc_base[ch->dma.desc].ctl =
@@ -135,7 +135,7 @@ ltq_etop_hw_receive(struct ltq_etop_chan *ch)
 	spin_lock_irqsave(&priv->lock, flags);
 	if (ltq_etop_alloc_skb(ch)) {
 		netdev_err(ch->netdev,
-			"failed to allocate new rx buffer, stopping DMA\n");
+			   "failed to allocate new rx buffer, stopping DMA\n");
 		ltq_dma_close(&ch->dma);
 	}
 	ch->dma.desc++;
@@ -185,7 +185,7 @@ ltq_etop_poll_tx(struct napi_struct *napi, int budget)
 		dev_kfree_skb_any(ch->skb[ch->tx_free]);
 		ch->skb[ch->tx_free] = NULL;
 		memset(&ch->dma.desc_base[ch->tx_free], 0,
-			sizeof(struct ltq_dma_desc));
+		       sizeof(struct ltq_dma_desc));
 		ch->tx_free++;
 		ch->tx_free %= LTQ_DESC_NUM;
 	}
@@ -246,18 +246,18 @@ ltq_etop_hw_init(struct net_device *dev)
 
 	switch (priv->pldata->mii_mode) {
 	case PHY_INTERFACE_MODE_RMII:
-		ltq_etop_w32_mask(ETOP_MII_MASK,
-			ETOP_MII_REVERSE, LTQ_ETOP_CFG);
+		ltq_etop_w32_mask(ETOP_MII_MASK, ETOP_MII_REVERSE,
+				  LTQ_ETOP_CFG);
 		break;
 
 	case PHY_INTERFACE_MODE_MII:
-		ltq_etop_w32_mask(ETOP_MII_MASK,
-			ETOP_MII_NORMAL, LTQ_ETOP_CFG);
+		ltq_etop_w32_mask(ETOP_MII_MASK, ETOP_MII_NORMAL,
+				  LTQ_ETOP_CFG);
 		break;
 
 	default:
 		netdev_err(dev, "unknown mii mode %d\n",
-			priv->pldata->mii_mode);
+			   priv->pldata->mii_mode);
 		return -ENOTSUPP;
 	}
 
@@ -399,7 +399,7 @@ ltq_etop_mdio_init(struct net_device *dev)
 	priv->mii_bus->write = ltq_etop_mdio_wr;
 	priv->mii_bus->name = "ltq_mii";
 	snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
-		priv->pdev->name, priv->pdev->id);
+		 priv->pdev->name, priv->pdev->id);
 	if (mdiobus_register(priv->mii_bus)) {
 		err = -ENXIO;
 		goto err_out_free_mdiobus;
@@ -539,7 +539,7 @@ ltq_etop_set_mac_address(struct net_device *dev, void *p)
 		spin_lock_irqsave(&priv->lock, flags);
 		ltq_etop_w32(*((u32 *)dev->dev_addr), LTQ_ETOP_MAC_DA0);
 		ltq_etop_w32(*((u16 *)&dev->dev_addr[4]) << 16,
-			LTQ_ETOP_MAC_DA1);
+			     LTQ_ETOP_MAC_DA1);
 		spin_unlock_irqrestore(&priv->lock, flags);
 	}
 	return ret;
@@ -652,15 +652,15 @@ ltq_etop_probe(struct platform_device *pdev)
 	}
 
 	res = devm_request_mem_region(&pdev->dev, res->start,
-		resource_size(res), dev_name(&pdev->dev));
+				      resource_size(res), dev_name(&pdev->dev));
 	if (!res) {
 		dev_err(&pdev->dev, "failed to request etop resource\n");
 		err = -EBUSY;
 		goto err_out;
 	}
 
-	ltq_etop_membase = devm_ioremap(&pdev->dev,
-		res->start, resource_size(res));
+	ltq_etop_membase = devm_ioremap(&pdev->dev, res->start,
+					resource_size(res));
 	if (!ltq_etop_membase) {
 		dev_err(&pdev->dev, "failed to remap etop engine %d\n",
 			pdev->id);
@@ -699,10 +699,10 @@ ltq_etop_probe(struct platform_device *pdev)
 	for (i = 0; i < MAX_DMA_CHAN; i++) {
 		if (IS_TX(i))
 			netif_napi_add(dev, &priv->ch[i].napi,
-				ltq_etop_poll_tx, 8);
+				       ltq_etop_poll_tx, 8);
 		else if (IS_RX(i))
 			netif_napi_add(dev, &priv->ch[i].napi,
-				ltq_etop_poll_rx, 32);
+				       ltq_etop_poll_rx, 32);
 		priv->ch[i].netdev = dev;
 	}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis
  2021-12-29 23:39 [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis Aleksander Jan Bajkowski
@ 2021-12-30  1:32 ` Joe Perches
  2022-01-08 15:48   ` Aleksander Bajkowski
  2021-12-30 13:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Perches @ 2021-12-30  1:32 UTC (permalink / raw)
  To: Aleksander Jan Bajkowski, davem, kuba, jgg, rdunlap, arnd,
	netdev, linux-kernel

On Thu, 2021-12-30 at 00:39 +0100, Aleksander Jan Bajkowski wrote:
> checkpatch.pl complains as the following:
> 
> Alignment should match open parenthesis
[]
> diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
[]
> @@ -111,9 +111,9 @@ ltq_etop_alloc_skb(struct ltq_etop_chan *ch)
>  	ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN);
>  	if (!ch->skb[ch->dma.desc])
>  		return -ENOMEM;
> -	ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(&priv->pdev->dev,
> -		ch->skb[ch->dma.desc]->data, MAX_DMA_DATA_LEN,
> -		DMA_FROM_DEVICE);
> +	ch->dma.desc_base[ch->dma.desc].addr =
> +		dma_map_single(&priv->pdev->dev, ch->skb[ch->dma.desc]->data,
> +			       MAX_DMA_DATA_LEN, DMA_FROM_DEVICE);
>  	ch->dma.desc_base[ch->dma.desc].addr =
>  		CPHYSADDR(ch->skb[ch->dma.desc]->data);

Unassociated trivia:

ch->dma.desc_base[ch->dma.desc].addr is the target of consecutive assignments.

That looks very odd.

Isn't the compiler allowed to toss/throw away the first assignment?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis
  2021-12-29 23:39 [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis Aleksander Jan Bajkowski
  2021-12-30  1:32 ` Joe Perches
@ 2021-12-30 13:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-30 13:30 UTC (permalink / raw)
  To: Aleksander Jan Bajkowski
  Cc: davem, kuba, jgg, rdunlap, arnd, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 30 Dec 2021 00:39:52 +0100 you wrote:
> checkpatch.pl complains as the following:
> 
> Alignment should match open parenthesis
> 
> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
> ---
>  drivers/net/ethernet/lantiq_etop.c | 34 +++++++++++++++---------------
>  1 file changed, 17 insertions(+), 17 deletions(-)

Here is the summary with links:
  - [net-next] net: lantiq_etop: make alignment match open parenthesis
    https://git.kernel.org/netdev/net-next/c/7a6653adde03

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis
  2021-12-30  1:32 ` Joe Perches
@ 2022-01-08 15:48   ` Aleksander Bajkowski
  0 siblings, 0 replies; 4+ messages in thread
From: Aleksander Bajkowski @ 2022-01-08 15:48 UTC (permalink / raw)
  To: Joe Perches, davem, kuba, jgg, rdunlap, arnd, netdev, linux-kernel

Hi Joe,

On 12/30/21 02:32, Joe Perches wrote:
> On Thu, 2021-12-30 at 00:39 +0100, Aleksander Jan Bajkowski wrote:
>> checkpatch.pl complains as the following:
>>
>> Alignment should match open parenthesis
> []
>> diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
> []
>> @@ -111,9 +111,9 @@ ltq_etop_alloc_skb(struct ltq_etop_chan *ch)
>>  	ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN);
>>  	if (!ch->skb[ch->dma.desc])
>>  		return -ENOMEM;
>> -	ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(&priv->pdev->dev,
>> -		ch->skb[ch->dma.desc]->data, MAX_DMA_DATA_LEN,
>> -		DMA_FROM_DEVICE);
>> +	ch->dma.desc_base[ch->dma.desc].addr =
>> +		dma_map_single(&priv->pdev->dev, ch->skb[ch->dma.desc]->data,
>> +			       MAX_DMA_DATA_LEN, DMA_FROM_DEVICE);
>>  	ch->dma.desc_base[ch->dma.desc].addr =
>>  		CPHYSADDR(ch->skb[ch->dma.desc]->data);
> 
> Unassociated trivia:
> 
> ch->dma.desc_base[ch->dma.desc].addr is the target of consecutive assignments.
> 
> That looks very odd.
> 
> Isn't the compiler allowed to toss/throw away the first assignment?
> 
> 


I think you are right. This function should look similar to xrx200_alloc_skb().
Both drivers have the same DMA IP core and packet receiving mechanism.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-08 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 23:39 [PATCH net-next] net: lantiq_etop: make alignment match open parenthesis Aleksander Jan Bajkowski
2021-12-30  1:32 ` Joe Perches
2022-01-08 15:48   ` Aleksander Bajkowski
2021-12-30 13:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.