diff options
author | zhong jiang <zhongjiang@huawei.com> | 2018-09-19 19:32:14 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-19 20:58:05 -0700 |
commit | a90546e83a117502c36173a2809db5d00c9ac87d (patch) | |
tree | f0d3f11d9998993c9d451c8cc9f13522a981a8b3 /drivers/net/ethernet/ti | |
parent | e208cd5e41b400d90d5ba71981c7877e437671cc (diff) | |
download | blackbird-obmc-linux-a90546e83a117502c36173a2809db5d00c9ac87d.tar.gz blackbird-obmc-linux-a90546e83a117502c36173a2809db5d00c9ac87d.zip |
net: ti: Use FIELD_SIZEOF directly instead of reimplementing its function
FIELD_SIZEOF is defined as a macro to calculate the specified value. Therefore,
We prefer to use the macro rather than calculating its value.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 832bce07c385..16dcbf36f8cc 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -484,13 +484,13 @@ enum { }; #define CPSW_STAT(m) CPSW_STATS, \ - sizeof(((struct cpsw_hw_stats *)0)->m), \ + FIELD_SIZEOF(struct cpsw_hw_stats, m), \ offsetof(struct cpsw_hw_stats, m) #define CPDMA_RX_STAT(m) CPDMA_RX_STATS, \ - sizeof(((struct cpdma_chan_stats *)0)->m), \ + FIELD_SIZEOF(struct cpdma_chan_stats, m), \ offsetof(struct cpdma_chan_stats, m) #define CPDMA_TX_STAT(m) CPDMA_TX_STATS, \ - sizeof(((struct cpdma_chan_stats *)0)->m), \ + FIELD_SIZEOF(struct cpdma_chan_stats, m), \ offsetof(struct cpdma_chan_stats, m) static const struct cpsw_stats cpsw_gstrings_stats[] = { |