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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 355F2C4332F for ; Tue, 8 Nov 2022 17:16:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233539AbiKHRQS (ORCPT ); Tue, 8 Nov 2022 12:16:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234497AbiKHRQJ (ORCPT ); Tue, 8 Nov 2022 12:16:09 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 822E459FF9 for ; Tue, 8 Nov 2022 09:15:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 44507B81BDE for ; Tue, 8 Nov 2022 17:15:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0ADDC433D6; Tue, 8 Nov 2022 17:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667927754; bh=wRyf14kNFEn854+78KyA7DceGOKdMIJZaXiM/FsMW84=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Yyf+dFIQ2HZ9j8F93vks/7uqb4w6JmjJ3uKnISNtRSq1G+tcKkQRLNNNbS4IgzKy2 Y7O8wcNK8zhKaoDa8TGXac7zmGenVrthufrUtBMd3bQW1tyM10wqKZNOe8AmRTI9lI l56Qxjihtf5EVhQPtywTBoOznqqPjFQ6ZMnTzmZH6kcprXKeKPgOF14K7QURkxKEOZ Qv7AJXKWgZ/28eL+YTj1FvOgK3U6uN/UEI6wkj69a7PHCcJnxuhzvs5U3AWiJmZo1W pvEp0S7+G4twgE9ZBbfVMk88wMlUW9hDa4Da3uSJ0NHqtQsTYsNAdgX4Oi35MrJHOL e0nRSfF9LPiEg== Date: Tue, 8 Nov 2022 11:15:53 -0600 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: kernel test robot , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-pci@vger.kernel.org Subject: Re: [helgaas-pci:pci/enumeration 3/3] drivers/pci/probe.c:909:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true Message-ID: <20221108171553.GA479740@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221108170619.jmcfvcuggkwjfo7j@pali> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Tue, Nov 08, 2022 at 06:06:19PM +0100, Pali Rohár wrote: > On Tuesday 08 November 2022 07:08:16 Bjorn Helgaas wrote: > > Why did the bot tell me the build was *SUCCESSFUL* even though this is > > clearly a problem? Here's the "success" message: > > > > https://lore.kernel.org/all/636a47ad.UocsB2qjv%2FcFWvK2%25lkp@intel.com/ > > > > On Tue, Nov 08, 2022 at 03:21:20PM +0800, kernel test robot wrote: > > > > > >> drivers/pci/probe.c:909:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > > > if (bus->domain_nr < 0) > > > ^~~~~~~~~~~~~~~~~~ > > > > I set "err = -EINVAL" here; let me know if you prefer something > > different. > > Hello! I agree that there is missing err= assignment. > > Instead of -EINVAL you can use also bus->domain_nr as it is negative and > would contained error code (from ida_alloc() call). Good idea, I adopted that :)