]> git.baikalelectronics.ru Git - kernel.git/commit
net: cls_api: remove unneeded local variable in tc_dump_chain()
authorLukas Bulwahn <lukas.bulwahn@gmail.com>
Wed, 28 Oct 2020 11:35:33 +0000 (12:35 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Oct 2020 21:05:55 +0000 (14:05 -0700)
commit950a64afc3fe9c814201199a49552f96102366c2
tree3b73d9f7a6cc649812dd0b48925773ac6c6ca063
parente49172440a147de429251d2d599e1d2410bc063a
net: cls_api: remove unneeded local variable in tc_dump_chain()

make clang-analyzer on x86_64 defconfig caught my attention with:

net/sched/cls_api.c:2964:3: warning: Value stored to 'parent' is never read
  [clang-analyzer-deadcode.DeadStores]
                parent = 0;
                ^

net/sched/cls_api.c:2977:4: warning: Value stored to 'parent' is never read
  [clang-analyzer-deadcode.DeadStores]
                        parent = q->handle;
                        ^

Commit b73bda75ff93 ("net: sched: introduce chain object to uapi")
introduced tc_dump_chain() and this initial implementation already
contained these unneeded dead stores.

Simplify the code to make clang-analyzer happy.

As compilers will detect these unneeded assignments and optimize this
anyway, the resulting binary is identical before and after this change.

No functional change. No change in object code.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20201028113533.26160-1-lukas.bulwahn@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/cls_api.c