diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2013-10-27 17:02:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-29 00:14:03 -0400 |
commit | 262e827fe745642589450ae241b7afd3912c3f25 (patch) | |
tree | 32e472ba8d018247c80ebf1a32eedbd7ba931a06 | |
parent | 826cb7b43b5bd8995f84edeacbbf569946a58f7c (diff) |
cxgb3: Fix length calculation in write_ofld_wr() on 32-bit architectures
The length calculation here is now invalid on 32-bit architectures,
since sk_buff::tail is a pointer and sk_buff::transport_header is
an integer offset:
drivers/net/ethernet/chelsio/cxgb3/sge.c: In function 'write_ofld_wr':
drivers/net/ethernet/chelsio/cxgb3/sge.c:1603:9: warning: passing argument 4 of 'make_sgl' makes integer from pointer without a cast [enabled by default]
adap->pdev);
^
drivers/net/ethernet/chelsio/cxgb3/sge.c:964:28: note: expected 'unsigned int' but argument is of type 'sk_buff_data_t'
static inline unsigned int make_sgl(const struct sk_buff *skb,
^
Use the appropriate skb accessor functions.
Compile-tested only.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: 1a37e412a022 ('net: Use 16bits for *_headers fields of struct skbuff')
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/sge.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c index 9c89dc8fe105..632b318eb38a 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c | |||
@@ -1599,7 +1599,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb, | |||
1599 | flits = skb_transport_offset(skb) / 8; | 1599 | flits = skb_transport_offset(skb) / 8; |
1600 | sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; | 1600 | sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; |
1601 | sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), | 1601 | sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), |
1602 | skb->tail - skb->transport_header, | 1602 | skb_tail_pointer(skb) - |
1603 | skb_transport_header(skb), | ||
1603 | adap->pdev); | 1604 | adap->pdev); |
1604 | if (need_skb_unmap()) { | 1605 | if (need_skb_unmap()) { |
1605 | setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); | 1606 | setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); |