Commit 93c8acb5 authored by Takahiro Shimizu's avatar Takahiro Shimizu Committed by David S. Miller

pch_gbe: improve coding style

This patch clears up a few coding style issues:

- Makes two function definitions a bit nicer looking.
- Remove unneeded parentheses.
- Simplify macros for register bits.

[ RC - Rebased Takahiro's changes and wrote a commit message
  explaining the changes. ]
Signed-off-by: default avatarTakahiro Shimizu <tshimizu818@gmail.com>
Signed-off-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 17cdedf3
...@@ -103,9 +103,9 @@ const char pch_driver_version[] = DRV_VERSION; ...@@ -103,9 +103,9 @@ const char pch_driver_version[] = DRV_VERSION;
/* Macros for ieee1588 */ /* Macros for ieee1588 */
/* 0x40 Time Synchronization Channel Control Register Bits */ /* 0x40 Time Synchronization Channel Control Register Bits */
#define MASTER_MODE (1<<0) #define MASTER_MODE (1<<0)
#define SLAVE_MODE (0<<0) #define SLAVE_MODE (0)
#define V2_MODE (1<<31) #define V2_MODE (1<<31)
#define CAP_MODE0 (0<<16) #define CAP_MODE0 (0)
#define CAP_MODE2 (1<<17) #define CAP_MODE2 (1<<17)
/* 0x44 Time Synchronization Channel Event Register Bits */ /* 0x44 Time Synchronization Channel Event Register Bits */
...@@ -151,8 +151,8 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid) ...@@ -151,8 +151,8 @@ static int pch_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seqid)
seqid == *id); seqid == *id);
} }
static void pch_rx_timestamp( static void
struct pch_gbe_adapter *adapter, struct sk_buff *skb) pch_rx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb)
{ {
struct skb_shared_hwtstamps *shhwtstamps; struct skb_shared_hwtstamps *shhwtstamps;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -189,8 +189,8 @@ static void pch_rx_timestamp( ...@@ -189,8 +189,8 @@ static void pch_rx_timestamp(
pch_ch_event_write(pdev, RX_SNAPSHOT_LOCKED); pch_ch_event_write(pdev, RX_SNAPSHOT_LOCKED);
} }
static void pch_tx_timestamp( static void
struct pch_gbe_adapter *adapter, struct sk_buff *skb) pch_tx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb)
{ {
struct skb_shared_hwtstamps shhwtstamps; struct skb_shared_hwtstamps shhwtstamps;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -263,15 +263,15 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) ...@@ -263,15 +263,15 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
break; break;
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
adapter->hwts_rx_en = 0; adapter->hwts_rx_en = 0;
pch_ch_control_write(pdev, (SLAVE_MODE | CAP_MODE0)); pch_ch_control_write(pdev, SLAVE_MODE | CAP_MODE0);
break; break;
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
adapter->hwts_rx_en = 1; adapter->hwts_rx_en = 1;
pch_ch_control_write(pdev, (MASTER_MODE | CAP_MODE0)); pch_ch_control_write(pdev, MASTER_MODE | CAP_MODE0);
break; break;
case HWTSTAMP_FILTER_PTP_V2_EVENT: case HWTSTAMP_FILTER_PTP_V2_EVENT:
adapter->hwts_rx_en = 1; adapter->hwts_rx_en = 1;
pch_ch_control_write(pdev, (V2_MODE | CAP_MODE2)); pch_ch_control_write(pdev, V2_MODE | CAP_MODE2);
break; break;
default: default:
return -ERANGE; return -ERANGE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment