Commit 5258830b authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: simplify fragment type selection

Improve readability of the code that determines a buffer element's
fragment type, and reduce the number of cases down from 5 to 3.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Acked-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 699d3fe5
...@@ -3918,21 +3918,14 @@ static inline void __qeth_fill_buffer(struct sk_buff *skb, ...@@ -3918,21 +3918,14 @@ static inline void __qeth_fill_buffer(struct sk_buff *skb,
buffer->element[element].addr = data; buffer->element[element].addr = data;
buffer->element[element].length = length_here; buffer->element[element].length = length_here;
length -= length_here; length -= length_here;
if (!length) { if (first_lap) {
if (first_lap) if (length || skb_is_nonlinear(skb))
if (skb_shinfo(skb)->nr_frags) /* skb needs additional elements */
buffer->element[element].eflags = buffer->element[element].eflags =
SBAL_EFLAGS_FIRST_FRAG; SBAL_EFLAGS_FIRST_FRAG;
else else
buffer->element[element].eflags = 0; buffer->element[element].eflags = 0;
else
buffer->element[element].eflags =
SBAL_EFLAGS_MIDDLE_FRAG;
} else { } else {
if (first_lap)
buffer->element[element].eflags =
SBAL_EFLAGS_FIRST_FRAG;
else
buffer->element[element].eflags = buffer->element[element].eflags =
SBAL_EFLAGS_MIDDLE_FRAG; SBAL_EFLAGS_MIDDLE_FRAG;
} }
......
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