net: ipa: don't reuse variable names
authorAlex Elder <elder@linaro.org>
Sat, 10 Sep 2022 01:11:29 +0000 (20:11 -0500)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Sep 2022 14:45:47 +0000 (07:45 -0700)
commit9eefd2fb966da7034528ce9bfc8a7fc03869f589
tree2c8fdbc6b8ea5dedb1c92419aac7d6be3a7dc01a
parent8b3cb084b23e0a8ab7ce748c7f27ba828b74cde9
net: ipa: don't reuse variable names

In ipa_endpoint_init_hdr(), as well as ipa_endpoint_init_hdr_ext(),
a top-level automatic variable named "offset" is used to represent
the offset of a register.

However, deeper within each of those functions is *another*
definition of a local variable with the same name, representing
something else.  Scoping rules ensure the result is what was
intended, but this variable name reuse is bad practice and makes
the code confusing.

Fix this by naming the inner variable "off".  Use "off" instead of
"checksum_offset" in ipa_endpoint_init_cfg() for consistency.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_endpoint.c