]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7adb48d46af4b9f3ddd767652fed8119066fa23d
tree2c8fdbc6b8ea5dedb1c92419aac7d6be3a7dc01a
parent5e08b646a5c519f0310cd151febb419208a08e8e
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