netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: axienet: Fix coding style issues
@ 2024-07-17 18:54 Radhey Shyam Pandey
  2024-07-17 20:38 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Radhey Shyam Pandey @ 2024-07-17 18:54 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, michal.simek, andrew
  Cc: netdev, linux-arm-kernel, linux-kernel, git,
	Appana Durga Kedareswara Rao, Radhey Shyam Pandey

From: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>

Replace all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl
"CHECK" output "Prefer using the BIT macro".

It also removes unnecessary ftrace-like logging, add missing blank line
after declaration and remove unnecessary parentheses around 'ndev->mtu
<= XAE_JUMBO_MTU' and 'ndev->mtu > XAE_MTU'.

Signed-off-by: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
---
 drivers/net/ethernet/xilinx/xilinx_axienet.h  | 28 +++++++++----------
 .../net/ethernet/xilinx/xilinx_axienet_main.c |  7 ++---
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h
index fa5500decc96..0d5b300107e0 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
@@ -29,26 +29,26 @@
 /* Configuration options */
 
 /* Accept all incoming packets. Default: disabled (cleared) */
-#define XAE_OPTION_PROMISC			(1 << 0)
+#define XAE_OPTION_PROMISC			BIT(0)
 
 /* Jumbo frame support for Tx & Rx. Default: disabled (cleared) */
-#define XAE_OPTION_JUMBO			(1 << 1)
+#define XAE_OPTION_JUMBO			BIT(1)
 
 /* VLAN Rx & Tx frame support. Default: disabled (cleared) */
-#define XAE_OPTION_VLAN				(1 << 2)
+#define XAE_OPTION_VLAN				BIT(2)
 
 /* Enable recognition of flow control frames on Rx. Default: enabled (set) */
-#define XAE_OPTION_FLOW_CONTROL			(1 << 4)
+#define XAE_OPTION_FLOW_CONTROL			BIT(4)
 
 /* Strip FCS and PAD from incoming frames. Note: PAD from VLAN frames is not
  * stripped. Default: disabled (set)
  */
-#define XAE_OPTION_FCS_STRIP			(1 << 5)
+#define XAE_OPTION_FCS_STRIP			BIT(5)
 
 /* Generate FCS field and add PAD automatically for outgoing frames.
  * Default: enabled (set)
  */
-#define XAE_OPTION_FCS_INSERT			(1 << 6)
+#define XAE_OPTION_FCS_INSERT			BIT(6)
 
 /* Enable Length/Type error checking for incoming frames. When this option is
  * set, the MAC will filter frames that have a mismatched type/length field
@@ -56,13 +56,13 @@
  * types of frames are encountered. When this option is cleared, the MAC will
  * allow these types of frames to be received. Default: enabled (set)
  */
-#define XAE_OPTION_LENTYPE_ERR			(1 << 7)
+#define XAE_OPTION_LENTYPE_ERR			BIT(7)
 
 /* Enable the transmitter. Default: enabled (set) */
-#define XAE_OPTION_TXEN				(1 << 11)
+#define XAE_OPTION_TXEN				BIT(11)
 
 /*  Enable the receiver. Default: enabled (set) */
-#define XAE_OPTION_RXEN				(1 << 12)
+#define XAE_OPTION_RXEN				BIT(12)
 
 /*  Default options set when device is initialized or reset */
 #define XAE_OPTION_DEFAULTS				   \
@@ -326,11 +326,11 @@
 #define XAE_MULTICAST_CAM_TABLE_NUM	4
 
 /* Axi Ethernet Synthesis features */
-#define XAE_FEATURE_PARTIAL_RX_CSUM	(1 << 0)
-#define XAE_FEATURE_PARTIAL_TX_CSUM	(1 << 1)
-#define XAE_FEATURE_FULL_RX_CSUM	(1 << 2)
-#define XAE_FEATURE_FULL_TX_CSUM	(1 << 3)
-#define XAE_FEATURE_DMA_64BIT		(1 << 4)
+#define XAE_FEATURE_PARTIAL_RX_CSUM	BIT(0)
+#define XAE_FEATURE_PARTIAL_TX_CSUM	BIT(1)
+#define XAE_FEATURE_FULL_RX_CSUM	BIT(2)
+#define XAE_FEATURE_FULL_TX_CSUM	BIT(3)
+#define XAE_FEATURE_DMA_64BIT		BIT(4)
 
 #define XAE_NO_CSUM_OFFLOAD		0
 
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index e342f387c3dd..8c6f5af55958 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -415,6 +415,7 @@ static void axienet_set_mac_address(struct net_device *ndev,
 static int netdev_set_mac_address(struct net_device *ndev, void *p)
 {
 	struct sockaddr *addr = p;
+
 	axienet_set_mac_address(ndev, addr->sa_data);
 	return 0;
 }
@@ -613,8 +614,7 @@ static int axienet_device_reset(struct net_device *ndev)
 	lp->options |= XAE_OPTION_VLAN;
 	lp->options &= (~XAE_OPTION_JUMBO);
 
-	if ((ndev->mtu > XAE_MTU) &&
-	    (ndev->mtu <= XAE_JUMBO_MTU)) {
+	if (ndev->mtu > XAE_MTU && ndev->mtu <= XAE_JUMBO_MTU) {
 		lp->max_frm_size = ndev->mtu + VLAN_ETH_HLEN +
 					XAE_TRL_SIZE;
 
@@ -1514,8 +1514,6 @@ static int axienet_open(struct net_device *ndev)
 	int ret;
 	struct axienet_local *lp = netdev_priv(ndev);
 
-	dev_dbg(&ndev->dev, "%s\n", __func__);
-
 	/* When we do an Axi Ethernet reset, it resets the complete core
 	 * including the MDIO. MDIO must be disabled before resetting.
 	 * Hold MDIO bus lock to avoid MDIO accesses during the reset.
@@ -1657,6 +1655,7 @@ static int axienet_change_mtu(struct net_device *ndev, int new_mtu)
 static void axienet_poll_controller(struct net_device *ndev)
 {
 	struct axienet_local *lp = netdev_priv(ndev);
+
 	disable_irq(lp->tx_irq);
 	disable_irq(lp->rx_irq);
 	axienet_rx_irq(lp->tx_irq, ndev);

base-commit: 51835949dda3783d4639cfa74ce13a3c9829de00
-- 
2.34.1


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

* Re: [PATCH net-next] net: axienet: Fix coding style issues
  2024-07-17 18:54 [PATCH net-next] net: axienet: Fix coding style issues Radhey Shyam Pandey
@ 2024-07-17 20:38 ` Andrew Lunn
  2024-07-18  0:00 ` Jakub Kicinski
  2024-07-18  9:06 ` Paolo Abeni
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2024-07-17 20:38 UTC (permalink / raw)
  To: Radhey Shyam Pandey
  Cc: davem, edumazet, kuba, pabeni, michal.simek, netdev,
	linux-arm-kernel, linux-kernel, git, Appana Durga Kedareswara Rao

On Thu, Jul 18, 2024 at 12:24:43AM +0530, Radhey Shyam Pandey wrote:
> From: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>
> 
> Replace all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl
> "CHECK" output "Prefer using the BIT macro".
> 
> It also removes unnecessary ftrace-like logging, add missing blank line
> after declaration and remove unnecessary parentheses around 'ndev->mtu
> <= XAE_JUMBO_MTU' and 'ndev->mtu > XAE_MTU'.

Ideally, this should of been multiple patches. In general, we want a
patch to do one thing, which makes it easier to review.

net-next is closed at the moment due to the merge window. Please
repost in two weeks, once it opens again.

	Andrew

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

* Re: [PATCH net-next] net: axienet: Fix coding style issues
  2024-07-17 18:54 [PATCH net-next] net: axienet: Fix coding style issues Radhey Shyam Pandey
  2024-07-17 20:38 ` Andrew Lunn
@ 2024-07-18  0:00 ` Jakub Kicinski
  2024-07-18 11:45   ` Jiri Pirko
  2024-07-18  9:06 ` Paolo Abeni
  2 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2024-07-18  0:00 UTC (permalink / raw)
  To: Radhey Shyam Pandey
  Cc: davem, edumazet, pabeni, michal.simek, andrew, netdev,
	linux-arm-kernel, linux-kernel, git, Appana Durga Kedareswara Rao

On Thu, 18 Jul 2024 00:24:43 +0530 Radhey Shyam Pandey wrote:
> Replace all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl
> "CHECK" output "Prefer using the BIT macro".

FWIW the BIT() thing is a matter of preference, we don't enforce it
strictly in networking, it may not be worth patching. Up to you.

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

* Re: [PATCH net-next] net: axienet: Fix coding style issues
  2024-07-17 18:54 [PATCH net-next] net: axienet: Fix coding style issues Radhey Shyam Pandey
  2024-07-17 20:38 ` Andrew Lunn
  2024-07-18  0:00 ` Jakub Kicinski
@ 2024-07-18  9:06 ` Paolo Abeni
  2 siblings, 0 replies; 5+ messages in thread
From: Paolo Abeni @ 2024-07-18  9:06 UTC (permalink / raw)
  To: Radhey Shyam Pandey, davem, edumazet, kuba, michal.simek, andrew
  Cc: netdev, linux-arm-kernel, linux-kernel, git,
	Appana Durga Kedareswara Rao

On 7/17/24 20:54, Radhey Shyam Pandey wrote:
> From: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>
> 
> Replace all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl
> "CHECK" output "Prefer using the BIT macro".
> 
> It also removes unnecessary ftrace-like logging, add missing blank line
> after declaration and remove unnecessary parentheses around 'ndev->mtu
> <= XAE_JUMBO_MTU' and 'ndev->mtu > XAE_MTU'.
> 
> Signed-off-by: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>

## Form letter - net-next-closed

The merge window for v6.11 and therefore net-next is closed for new
drivers, features, code refactoring and optimizations. We are currently
accepting bug fixes only.

Please repost when net-next reopens after July 29th.

RFC patches sent for review only are obviously welcome at any time.

See:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
-- 
pw-bot: defer


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

* Re: [PATCH net-next] net: axienet: Fix coding style issues
  2024-07-18  0:00 ` Jakub Kicinski
@ 2024-07-18 11:45   ` Jiri Pirko
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2024-07-18 11:45 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Radhey Shyam Pandey, davem, edumazet, pabeni, michal.simek,
	andrew, netdev, linux-arm-kernel, linux-kernel, git,
	Appana Durga Kedareswara Rao

Thu, Jul 18, 2024 at 02:00:43AM CEST, kuba@kernel.org wrote:
>On Thu, 18 Jul 2024 00:24:43 +0530 Radhey Shyam Pandey wrote:
>> Replace all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl
>> "CHECK" output "Prefer using the BIT macro".
>
>FWIW the BIT() thing is a matter of preference, we don't enforce it
>strictly in networking, it may not be worth patching. Up to you.

In the past, I recall we did.

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

end of thread, other threads:[~2024-07-18 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 18:54 [PATCH net-next] net: axienet: Fix coding style issues Radhey Shyam Pandey
2024-07-17 20:38 ` Andrew Lunn
2024-07-18  0:00 ` Jakub Kicinski
2024-07-18 11:45   ` Jiri Pirko
2024-07-18  9:06 ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).