net: pkt: adjust_offset: Simplify and optimize code
An edge condition was handled in a special way, even though the main condition covered it well. More code, more jumps == slower code, bigger binaries. Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
committed by
Jukka Rissanen
parent
ae0f3d7224
commit
971da9d011
@@ -1215,11 +1215,7 @@ static inline struct net_buf *adjust_offset(struct net_buf *frag,
|
||||
}
|
||||
|
||||
while (frag) {
|
||||
if (offset == frag->len) {
|
||||
*pos = 0;
|
||||
|
||||
return frag->frags;
|
||||
} else if (offset < frag->len) {
|
||||
if (offset < frag->len) {
|
||||
*pos = offset;
|
||||
|
||||
return frag;
|
||||
|
||||
Reference in New Issue
Block a user