]> 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)
commit5ca10706d88fa568e43fb27b6290087fdb322f16
tree2c8fdbc6b8ea5dedb1c92419aac7d6be3a7dc01a
parente4437aeb4dcd9b724c4b197cbd833a85ff10c815
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