]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
drivers: net: ethernet: axienet: code style fix
authorSaurabh Sengar <saurabh.singh@xilinx.com>
Wed, 1 Mar 2017 09:29:40 +0000 (14:59 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 15 Mar 2018 14:17:55 +0000 (15:17 +0100)
Fixing the checkpatch.pl errors and compile warnings

Signed-off-by: Saurabh Sengar <saurabhs@xilinx.com>
Reviewed-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 784b97288a5225a7b71c7f29704557211e7f6004..7f1b3f5f3c1e9b9b940761b693a7e218295445c8 100644 (file)
 /* 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
  * 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                               \
 #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_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_NO_CSUM_OFFLOAD            0
 
 
 #define XAXIENET_NAPI_WEIGHT           64
 
-/* Defintions of 1588 PTP in Axi Ethernet IP */
+/* Definitions of 1588 PTP in Axi Ethernet IP */
 #define TX_TS_OP_NOOP           0x0
 #define TX_TS_OP_ONESTEP        0x1
 #define TX_TS_OP_TWOSTEP        0x2
index 10f87d227247891049525deeabd67dffcc323223..6eea816e71df6c4b45582c8dd392c00364977bbc 100644 (file)
@@ -562,8 +562,7 @@ static void axienet_device_reset(struct net_device *ndev)
                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;
                if (lp->max_frm_size <= lp->rxmem &&
@@ -720,7 +719,7 @@ static void axienet_tx_hwtstamp(struct axienet_local *lp,
                                        len), 0, 1000000);
        if (err)
                netdev_err(lp->ndev, "%s: Didn't get the full timestamp packet",
-                           __func__);
+                          __func__);
 
        nsec = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
        sec  = axienet_txts_ior(lp, XAXIFIFO_TXTS_RXFD);
@@ -1209,7 +1208,7 @@ static int axienet_recv(struct net_device *ndev, int budget)
                packets++;
 
                new_skb = netdev_alloc_skb(ndev, lp->max_frm_size);
-               if (new_skb == NULL) {
+               if (!new_skb) {
                        dev_err(lp->dev, "No memory for new_skb\n\r");
                        break;
                }
@@ -1815,7 +1814,7 @@ static int axienet_ethtools_get_regs_len(struct net_device *ndev)
 static void axienet_ethtools_get_regs(struct net_device *ndev,
                                      struct ethtool_regs *regs, void *ret)
 {
-       u32 *data = (u32 *) ret;
+       u32 *data = (u32 *)ret;
        size_t len = sizeof(u32) * AXIENET_REGS_N;
        struct axienet_local *lp = netdev_priv(ndev);
 
@@ -2229,7 +2228,7 @@ MODULE_DEVICE_TABLE(of, axienet_of_match);
  */
 static int axienet_probe(struct platform_device *pdev)
 {
-       int ret;
+       int ret = 0;
        struct device_node *np;
        struct axienet_local *lp;
        struct net_device *ndev;