diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-10-08 09:44:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-08 16:08:04 -0400 |
commit | fb5ac0de10ed49f9a18f47ec6d2edf359811ba58 (patch) | |
tree | 8a95c05fe5d9fb2730c628ada6d953b31479e431 | |
parent | 9fef84780348bbc01b14c1a0f88440ee67cfddfe (diff) |
cxgb4: clean up a type issue
The tx_desc struct holds 8 __be64 values. The original code in
ring_tx_db() took a tx_desc pointer then casted it to an int pointer and
then casted it to a u64 pointer. It was confusing and triggered some
static checker warnings.
I have changed the cxgb_pio_copy() function to only take tx_desc
pointers. This isn't really a loss of flexibility because anything else
was buggy to begin with.
I also removed the casting on the destination pointer since that was
unnecessary and a bit messy.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/sge.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index e8e90ce3ae15..fab4c84a1da4 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c | |||
@@ -850,13 +850,14 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q, | |||
850 | *end = 0; | 850 | *end = 0; |
851 | } | 851 | } |
852 | 852 | ||
853 | /* This function copies 64 byte coalesced work request to | 853 | /* This function copies a tx_desc struct to memory mapped BAR2 space(user space |
854 | * memory mapped BAR2 space(user space writes). | 854 | * writes). For coalesced WR SGE, fetches data from the FIFO instead of from |
855 | * For coalesced WR SGE, fetches data from the FIFO instead of from Host. | 855 | * Host. |
856 | */ | 856 | */ |
857 | static void cxgb_pio_copy(u64 __iomem *dst, u64 *src) | 857 | static void cxgb_pio_copy(u64 __iomem *dst, struct tx_desc *desc) |
858 | { | 858 | { |
859 | int count = 8; | 859 | int count = sizeof(*desc) / sizeof(u64); |
860 | u64 *src = (u64 *)desc; | ||
860 | 861 | ||
861 | while (count) { | 862 | while (count) { |
862 | writeq(*src, dst); | 863 | writeq(*src, dst); |
@@ -914,12 +915,9 @@ static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n) | |||
914 | int index = (q->pidx | 915 | int index = (q->pidx |
915 | ? (q->pidx - 1) | 916 | ? (q->pidx - 1) |
916 | : (q->size - 1)); | 917 | : (q->size - 1)); |
917 | unsigned int *wr = (unsigned int *)&q->desc[index]; | ||
918 | 918 | ||
919 | cxgb_pio_copy((u64 __iomem *) | 919 | cxgb_pio_copy(adap->bar2 + q->udb + SGE_UDB_WCDOORBELL, |
920 | (adap->bar2 + q->udb + | 920 | q->desc + index); |
921 | SGE_UDB_WCDOORBELL), | ||
922 | (u64 *)wr); | ||
923 | } else { | 921 | } else { |
924 | writel(val, adap->bar2 + q->udb + SGE_UDB_KDOORBELL); | 922 | writel(val, adap->bar2 + q->udb + SGE_UDB_KDOORBELL); |
925 | } | 923 | } |