From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C825C433F5 for ; Mon, 6 Sep 2021 16:40:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F05A860F45 for ; Mon, 6 Sep 2021 16:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244376AbhIFQlT (ORCPT ); Mon, 6 Sep 2021 12:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241972AbhIFQlQ (ORCPT ); Mon, 6 Sep 2021 12:41:16 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8740C061575 for ; Mon, 6 Sep 2021 09:40:11 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id m4so12190445ljq.8 for ; Mon, 06 Sep 2021 09:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kLGf+W5qZqIzs5xlBDQY6TASgcg+cDCU3+/hIp0WRSQ=; b=ZCv1Na58AgWFZ2iFATqhgehgaulyIV7J7ag0K8Y9oyChAGugX3AoStVPklc7w2OhPg W03/VpXx+xSMtO3MUalYb4qSLNbZUwmaR3J8n/O/fkWtK7HCB3hzAJVF5L9bMY1r5a5N giv5P0l+F0rwry5bA3jbyOOZV7JY1km7V1UkI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kLGf+W5qZqIzs5xlBDQY6TASgcg+cDCU3+/hIp0WRSQ=; b=iqgV5ETp24ahofp/xGNcSKLZZzb666/bUGS766++rmTGm44vgeDXLDm9sssMbvp9Do 83MsVg/34OAIdznfh5mAxwZjv0DeTfU33W4opfU8omOl3K8zUcvC1FuRZQSbvI7Qtj1N fzuW1ZI13aymwW08mfkUKGM3ZH1+g0Mygb5Ry2khBJDr5NI5nSc9BuXzdwz8+P0jm5gi 8SNHopN5W8kFXeGWXDrO+MqFFQZLucnQhytu3QDCmDfVSgCRqIRMaVU9VJhzlLFpGnOv kjb7CsMoFlQen6tSj3izM2zf4nwdkAwPWEYPF4f4ugadlVqsVgmmWUujA3GlTd4+hctd gDQw== X-Gm-Message-State: AOAM531TriVqARWKBtFgkJ1CBGDSkAtv9fd4hHuV3zY9SxwES+El53Tw X+FNFOPnQlRTrL9ZqDRKT6CKXdFbZPVdf7Nh+HM= X-Google-Smtp-Source: ABdhPJzfYMb8SSf72azxmDmiKl+4U9eJ2FthikKyuLMIknff80tlWcYTBFD/ujf2pkbJO6e6osbJtw== X-Received: by 2002:a2e:b24f:: with SMTP id n15mr11099881ljm.124.1630946409553; Mon, 06 Sep 2021 09:40:09 -0700 (PDT) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id f13sm782453lfs.193.2021.09.06.09.40.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Sep 2021 09:40:07 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id g14so12190476ljk.5 for ; Mon, 06 Sep 2021 09:40:07 -0700 (PDT) X-Received: by 2002:a2e:a7d0:: with SMTP id x16mr11178044ljp.494.1630946407467; Mon, 06 Sep 2021 09:40:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Mon, 6 Sep 2021 09:39:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: bridge.c:157:11: error: variable 'err' is used uninitialized whenever 'if' condition is false To: Naresh Kamboju , Vlad Buslov Cc: open list , clang-built-linux , lkft-triage@lists.linaro.org, Netdev , 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 On Mon, Sep 6, 2021 at 2:11 AM Naresh Kamboju wrote: > > drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c:157:11: error: > variable 'err' is used uninitialized whenever 'if' condition is false That compiler warning (now error) seems to be entirely valid. That's a if (..) else if (..) and if neither are valid then the code will return an uninitialized 'err'. It's possible the two conditionals are guaranteed to cover all cases, but as the compiler says, in that case the "if" in the else clause is pointless and should be removed. But it does look like 'ret' should probably just be initialized to 0. Linus