Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2655092pxb; Mon, 6 Sep 2021 02:12:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOmeKP3yj89DfJIL7R5mXVuZbKAPCZ2hWhF65fuz8rtd4rXMtHIVygDhYqWAcrE/9uJ8Bz X-Received: by 2002:a17:906:fb17:: with SMTP id lz23mr12369436ejb.438.1630919571520; Mon, 06 Sep 2021 02:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630919571; cv=none; d=google.com; s=arc-20160816; b=BRik1eoAKKqUtmdmXvn/zl6eup3OL1wyazaXnFxw5UA9KijMrtF//vBs7XlfFxGBNG WWM10x8cyhg2kKYCS9AP+NG2onC/9N5WPz+g1Rys8qnf6mcjFA0Uy4tBLNeLxiR7tJIP vHYMQ9hSgTBcFMjHGwVMMUWkziLTu9XVzKe/R37TDyXLayyYnkTE5CtBn/ulSE0EmLj0 87OQpJiQrsPyyHaQ0sj1f+BUBnFfe4v1r5SfSFFWoXUPWPiwuG/PjY0v6i96SWob1TuX X3cGIhOHoijh4LntJn286r34cCiGb/YkZ0KD8QqoC0bSxDXJiXo/w39CDtTo27DdSFoe VrwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=Hi4k8mC8CL14+JpmMfxB3pX6Pa/j8Ek3zliWtRdRWbY=; b=ksz7PQmUhzUm8y4q6TSqKvTl21egVK0GGz+Ey/8HBSNkqxFJnkEWfhU8WwSyOQ/0eo dmU3fNMNG+KLZnY/Avn/GZLqrVaNWqFDX+Wm/FXy7he7H4k6BHJndf8WTe+MhziX3jy8 FMFFfdGJo3xS42x6v2Jhw0FN7uMiAx5D6cSiVyI8wVU7Iwz82tPDF6HMXk+usZ2ueEfd jfO0NS9rgQAs6rsn9kz1qXtKQJk/NQ9uL3o0cg5O0Na+rLW7l0ScN5tliGPLNlBwu5aX x/iZHglYHPUBSTk60l+cKssR/oehqx4oS+Q94qu4un75tq3p2Z/6Odu/iuASHsoXv8ZC TsFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCBQOTgY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b67si7698187edf.129.2021.09.06.02.12.27; Mon, 06 Sep 2021 02:12:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCBQOTgY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240900AbhIFJMN (ORCPT + 99 others); Mon, 6 Sep 2021 05:12:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240727AbhIFJMM (ORCPT ); Mon, 6 Sep 2021 05:12:12 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926EAC061575 for ; Mon, 6 Sep 2021 02:11:07 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id r7so8600700edd.6 for ; Mon, 06 Sep 2021 02:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=Hi4k8mC8CL14+JpmMfxB3pX6Pa/j8Ek3zliWtRdRWbY=; b=WCBQOTgYvEvslSxbmTiQOgaY221XzlEViOHuyzF74lJGYlkYxi1f+t89NdCBKt6RD5 b7udVVd6fRYmnrHGu2kFYGQSIvMD45sbaFWsgY4NYL78O7tnR1s1I8VbPZgCwqJwyRDT 77y6/CAgFt9lDmZCUH1eDppvCUiKtqMwlh+1rio3DvBhArlukQBeB5RAbDFrOvBsaLuv Ory1+YLwUaTtsVUuO8wFcr64gieCfI0N6WNkXWMIFmpziHdbjjV7BdQjQccKPsL2D0Ys w/3WdrL58bnqGYJvkMwSCm+ZIpSJkgRLRUylihcYL26i6dZvHvE9dMi8wkommjQLCBmp 3nBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Hi4k8mC8CL14+JpmMfxB3pX6Pa/j8Ek3zliWtRdRWbY=; b=AQcgeZ2/C9s+khxOb7gAbRiEaj/mZNA0Agb1y7QAs24YR/wB6ei3pvNhWxaaUd5/aD NGFi/G1/URpMpSV0pp78t6VJCKv807kv0jFuEMHoOzdOFqqpcZOtc1wMG8P3nbzdbsAm OTXk2rTduPIXaqy1bEMNBZbAcj49ZsGprjRQiFjsdqMAFc3AArl/ARqbtyHXwgYU/Y+S hcXlbP9QPkZOlkMVbINJ6XUKXkzXkADZbdJGLX5p1JQ76EhS5IT2u6pFvWjXBZrt0cKs 31N1UuO8hwAZOhvh+oSHfdwRRvQXfmS5g8kl8ue4KjSKLRLKnO9TO3gRrUlKgRm3sUiE 6QDg== X-Gm-Message-State: AOAM533M9bNyJu/12SvSa6CDHuao8zwcPj2YahumP6pQUd9R+SgSK3Ix 4M9j1+9ZGcmtN+B4ysh/luo06/4iM6/m3ROEGTQ40w96uYdZZA== X-Received: by 2002:aa7:db10:: with SMTP id t16mr12313802eds.357.1630919464755; Mon, 06 Sep 2021 02:11:04 -0700 (PDT) MIME-Version: 1.0 From: Naresh Kamboju Date: Mon, 6 Sep 2021 14:40:53 +0530 Message-ID: Subject: bridge.c:157:11: error: variable 'err' is used uninitialized whenever 'if' condition is false To: open list , clang-built-linux , lkft-triage@lists.linaro.org, Netdev Cc: Linus Torvalds , Nathan Chancellor , Nick Desaulniers , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [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 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