From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52C006119; Tue, 8 Nov 2022 17:15:55 +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> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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> 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 :)