LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Naresh Kamboju <naresh.kamboju@linaro.org>
To: open list <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	lkft-triage@lists.linaro.org, Netdev <netdev@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: bridge.c:157:11: error: variable 'err' is used uninitialized whenever 'if' condition is false
Date: Mon, 6 Sep 2021 14:40:53 +0530	[thread overview]
Message-ID: <CA+G9fYsV7sTfaefGj3bpkvVdRQUeiWCVRiu6ovjtM=qri-HJ8g@mail.gmail.com> (raw)

[Please ignore if it is already reported]

Following build warnings/ errors noticed while building linux mainline
master branch
with clang-nightly, clang-13, clang-12, clang-11 and clang-10 for
arm64 architecture.
Whereas gcc-11 build pass.

# to reproduce this build locally: tuxmake --target-arch=arm64
--kconfig=defconfig --toolchain=clang-nightly --wrapper=none
--environment=KBUILD_BUILD_TIMESTAMP=@1630870764
--environment=KBUILD_BUILD_USER=tuxmake
--environment=KBUILD_BUILD_HOST=tuxmake --runtime=podman
--image=855116176053.dkr.ecr.us-east-1.amazonaws.com/tuxmake/arm64_clang-nightly
config default kernel xipkernel modules dtbs dtbs-legacy debugkernel
headers
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/current ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu- HOSTCC=clang CC=clang defconfig
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/current ARCH=arm64
CROSS_COMPILE=aarch64-linux-gnu- HOSTCC=clang CC=clang
scripts/dtc/include-prefixes/arm/bcm2711-rpi-4-b.dts:220.10-231.4:
Warning (pci_device_reg): /scb/pcie@7d500000/pci@1,0: PCI unit address
format error, expected 0,0
scripts/dtc/include-prefixes/arm/bcm2711-rpi-4-b.dts:220.10-231.4:
Warning (pci_device_reg): /scb/pcie@7d500000/pci@1,0: PCI unit address
format error, expected 0,0
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi:464.3-52: Warning
(pci_device_reg): /pcie@f8000000/pcie@0,0:reg: PCI reg address is not
configuration space
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi:464.3-52: Warning
(pci_device_reg): /pcie@f8000000/pcie@0,0:reg: PCI reg address is not
configuration space
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi:464.3-52: Warning
(pci_device_reg): /pcie@f8000000/pcie@0,0:reg: PCI reg address is not
configuration space
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi:464.3-52: Warning
(pci_device_reg): /pcie@f8000000/pcie@0,0:reg: PCI reg address is not
configuration space
arch/arm64/kvm/hyp/nvhe/Makefile:58: FORCE prerequisite is missing
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:157:11: error:
variable 'err' is used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        else if (mlx5_esw_bridge_dev_same_hw(rep, esw))
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:164:9: note:
uninitialized use occurs here
        return err;
               ^~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:157:7: note:
remove the 'if' if its condition is always true
        else if (mlx5_esw_bridge_dev_same_hw(rep, esw))
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:140:9: note:
initialize the variable 'err' to silence this warning
        int err;
               ^
                = 0
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:262:7: error:
variable 'err' is used uninitialized whenever switch case is taken
[-Werror,-Wsometimes-uninitialized]
        case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:276:9: note:
uninitialized use occurs here
        return err;
               ^~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:257:7: error:
variable 'err' is used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
                if (attr->u.brport_flags.mask & ~(BR_LEARNING |
BR_FLOOD | BR_MCAST_FLOOD)) {

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:276:9: note:
uninitialized use occurs here
        return err;
               ^~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:257:3: note:
remove the 'if' if its condition is always true
                if (attr->u.brport_flags.mask & ~(BR_LEARNING |
BR_FLOOD | BR_MCAST_FLOOD)) {

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:247:9: note:
initialize the variable 'err' to silence this warning
        int err;
               ^
                = 0
3 errors generated.
make[6]: *** [scripts/Makefile.build:277:
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.o] Error 1
make[6]: Target '__build' not remade because of errors.
make[5]: *** [scripts/Makefile.build:540:
drivers/net/ethernet/mellanox/mlx5/core] Error 2
make[5]: Target '__build' not remade because of errors.
make[4]: *** [scripts/Makefile.build:540: drivers/net/ethernet/mellanox] Error 2
make[4]: Target '__build' not remade because of errors.
make[3]: *** [scripts/Makefile.build:540: drivers/net/ethernet] Error 2
make[3]: Target '__build' not remade because of errors.
make[2]: *** [scripts/Makefile.build:540: drivers/net] Error 2
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1872: drivers] Error 2
make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target '__all' not remade because of errors.

Build config:
https://builds.tuxbuild.com/1xjZrnXEZfc3qYzziclNRaugAaN/config

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

meta data:
-----------
    git_describe: v5.14-9687-g27151f177827
    git_repo: https://gitlab.com/Linaro/lkft/mirrors/torvalds/linux-mainline
    git_sha: 27151f177827d478508e756c7657273261aaf8a9
    git_short_log: 27151f177827 (\Merge tag
'perf-tools-for-v5.15-2021-09-04' of
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux\)
    kconfig: [
        defconfig
    ],
    kernel_version: 5.14.0
    status_message: failure while building tuxmake target(s): default
    target_arch: arm64
    toolchain: clang-nightly, clang-13, clang-12, clang-11 and clang-10

steps to reproduce:
https://builds.tuxbuild.com/1xjZrnXEZfc3qYzziclNRaugAaN/tuxmake_reproducer.sh

--
Linaro LKFT
https://lkft.linaro.org

             reply	other threads:[~2021-09-06  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  9:10 Naresh Kamboju [this message]
2021-09-06 16:39 ` Linus Torvalds
2021-09-06 17:35   ` Vlad Buslov
2021-09-07 20:34     ` Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+G9fYsV7sTfaefGj3bpkvVdRQUeiWCVRiu6ovjtM=qri-HJ8g@mail.gmail.com' \
    --to=naresh.kamboju@linaro.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: bridge.c:157:11: error: variable '\''err'\'' is used uninitialized whenever '\''if'\'' condition is false' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).