]> git.itanic.dy.fi Git - linux-stable/commit
net: ipa: refactor status buffer parsing
authorAlex Elder <elder@linaro.org>
Wed, 25 Jan 2023 20:45:38 +0000 (14:45 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jan 2023 11:16:28 +0000 (11:16 +0000)
commit63a560b5289a0f9d66d099fb093c20b0abe01027
treef661c2fcc38143733c64bd2791c20fe4180b1c0b
parentc8005511f38757ef071b34c0a98cf3d8a1c920a7
net: ipa: refactor status buffer parsing

The packet length encoded in an IPA packet status buffer is computed
more than once in ipa_endpoint_status_parse().  It is also checked
again in ipa_endpoint_status_skip(), which that function calls.

Compute the length once, and use that computed value later rather
than recomputing it.  Check for it being zero in the parse function
rather than in ipa_endpoint_status_skip().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_endpoint.c