Skip to content

Commit ce21e52

Browse files
committed
Merge branch 'axienet-coding-style' into main
Radhey Shyam Pandey says: ==================== net: axienet: Fix coding style issues This patchset 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'. Changes for v2: - Split each coding style change into separate patch. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3361a6e + 48ba8a1 commit ce21e52

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

drivers/net/ethernet/xilinx/xilinx_axienet.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,40 @@
2929
/* Configuration options */
3030

3131
/* Accept all incoming packets. Default: disabled (cleared) */
32-
#define XAE_OPTION_PROMISC (1 << 0)
32+
#define XAE_OPTION_PROMISC BIT(0)
3333

3434
/* Jumbo frame support for Tx & Rx. Default: disabled (cleared) */
35-
#define XAE_OPTION_JUMBO (1 << 1)
35+
#define XAE_OPTION_JUMBO BIT(1)
3636

3737
/* VLAN Rx & Tx frame support. Default: disabled (cleared) */
38-
#define XAE_OPTION_VLAN (1 << 2)
38+
#define XAE_OPTION_VLAN BIT(2)
3939

4040
/* Enable recognition of flow control frames on Rx. Default: enabled (set) */
41-
#define XAE_OPTION_FLOW_CONTROL (1 << 4)
41+
#define XAE_OPTION_FLOW_CONTROL BIT(4)
4242

4343
/* Strip FCS and PAD from incoming frames. Note: PAD from VLAN frames is not
4444
* stripped. Default: disabled (set)
4545
*/
46-
#define XAE_OPTION_FCS_STRIP (1 << 5)
46+
#define XAE_OPTION_FCS_STRIP BIT(5)
4747

4848
/* Generate FCS field and add PAD automatically for outgoing frames.
4949
* Default: enabled (set)
5050
*/
51-
#define XAE_OPTION_FCS_INSERT (1 << 6)
51+
#define XAE_OPTION_FCS_INSERT BIT(6)
5252

5353
/* Enable Length/Type error checking for incoming frames. When this option is
5454
* set, the MAC will filter frames that have a mismatched type/length field
5555
* and if XAE_OPTION_REPORT_RXERR is set, the user is notified when these
5656
* types of frames are encountered. When this option is cleared, the MAC will
5757
* allow these types of frames to be received. Default: enabled (set)
5858
*/
59-
#define XAE_OPTION_LENTYPE_ERR (1 << 7)
59+
#define XAE_OPTION_LENTYPE_ERR BIT(7)
6060

6161
/* Enable the transmitter. Default: enabled (set) */
62-
#define XAE_OPTION_TXEN (1 << 11)
62+
#define XAE_OPTION_TXEN BIT(11)
6363

6464
/* Enable the receiver. Default: enabled (set) */
65-
#define XAE_OPTION_RXEN (1 << 12)
65+
#define XAE_OPTION_RXEN BIT(12)
6666

6767
/* Default options set when device is initialized or reset */
6868
#define XAE_OPTION_DEFAULTS \
@@ -326,11 +326,11 @@
326326
#define XAE_MULTICAST_CAM_TABLE_NUM 4
327327

328328
/* Axi Ethernet Synthesis features */
329-
#define XAE_FEATURE_PARTIAL_RX_CSUM (1 << 0)
330-
#define XAE_FEATURE_PARTIAL_TX_CSUM (1 << 1)
331-
#define XAE_FEATURE_FULL_RX_CSUM (1 << 2)
332-
#define XAE_FEATURE_FULL_TX_CSUM (1 << 3)
333-
#define XAE_FEATURE_DMA_64BIT (1 << 4)
329+
#define XAE_FEATURE_PARTIAL_RX_CSUM BIT(0)
330+
#define XAE_FEATURE_PARTIAL_TX_CSUM BIT(1)
331+
#define XAE_FEATURE_FULL_RX_CSUM BIT(2)
332+
#define XAE_FEATURE_FULL_TX_CSUM BIT(3)
333+
#define XAE_FEATURE_DMA_64BIT BIT(4)
334334

335335
#define XAE_NO_CSUM_OFFLOAD 0
336336

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ static void axienet_set_mac_address(struct net_device *ndev,
415415
static int netdev_set_mac_address(struct net_device *ndev, void *p)
416416
{
417417
struct sockaddr *addr = p;
418+
418419
axienet_set_mac_address(ndev, addr->sa_data);
419420
return 0;
420421
}
@@ -613,8 +614,7 @@ static int axienet_device_reset(struct net_device *ndev)
613614
lp->options |= XAE_OPTION_VLAN;
614615
lp->options &= (~XAE_OPTION_JUMBO);
615616

616-
if ((ndev->mtu > XAE_MTU) &&
617-
(ndev->mtu <= XAE_JUMBO_MTU)) {
617+
if (ndev->mtu > XAE_MTU && ndev->mtu <= XAE_JUMBO_MTU) {
618618
lp->max_frm_size = ndev->mtu + VLAN_ETH_HLEN +
619619
XAE_TRL_SIZE;
620620

@@ -1514,8 +1514,6 @@ static int axienet_open(struct net_device *ndev)
15141514
int ret;
15151515
struct axienet_local *lp = netdev_priv(ndev);
15161516

1517-
dev_dbg(&ndev->dev, "%s\n", __func__);
1518-
15191517
/* When we do an Axi Ethernet reset, it resets the complete core
15201518
* including the MDIO. MDIO must be disabled before resetting.
15211519
* Hold MDIO bus lock to avoid MDIO accesses during the reset.
@@ -1576,8 +1574,6 @@ static int axienet_stop(struct net_device *ndev)
15761574
struct axienet_local *lp = netdev_priv(ndev);
15771575
int i;
15781576

1579-
dev_dbg(&ndev->dev, "axienet_close()\n");
1580-
15811577
if (!lp->use_dmaengine) {
15821578
napi_disable(&lp->napi_tx);
15831579
napi_disable(&lp->napi_rx);
@@ -1657,6 +1653,7 @@ static int axienet_change_mtu(struct net_device *ndev, int new_mtu)
16571653
static void axienet_poll_controller(struct net_device *ndev)
16581654
{
16591655
struct axienet_local *lp = netdev_priv(ndev);
1656+
16601657
disable_irq(lp->tx_irq);
16611658
disable_irq(lp->rx_irq);
16621659
axienet_rx_irq(lp->tx_irq, ndev);

0 commit comments

Comments
 (0)