Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6219089rdb; Thu, 14 Dec 2023 11:26:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkwO6B3UD50M/NR3ZpFXU70jKvc+HWitV0sKhyUOSCil1Q3m/edrd5Nb3GhitjE/wFbWq4 X-Received: by 2002:a17:90a:d597:b0:28a:aa82:6ab3 with SMTP id v23-20020a17090ad59700b0028aaa826ab3mr5028640pju.31.1702582014049; Thu, 14 Dec 2023 11:26:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702582014; cv=none; d=google.com; s=arc-20160816; b=DbVTL7TSDnvumF8AkWhI4kD42ylscPPa60fHw0EpJFA+8ivwf5yctg788Y5ZSpr1fA HX19iJdK3p0WnFgyc+j3iL2RmHwIo4jQOhhGYkFR1Ac7SgwL/nUUXaDDGOybh50SNZVH mylD8hRJNZwRcUsVVclK3TMW2YgqUEgOdazbNO9d6wFHVjC8CsAcrM1L6r9ZioHYUGF8 gYXFExsbfZn72v5VDcGg17UGw5Bdp+xS+S9Wt7d+NtHS+PzbHfBtsiNeiZwTTl1ROSts Tb3/BIE+1MshjrHVmoefJyBM7QDwpBNp1z5lSMmW3ebJfswYUKTZv/8BUXMmSIrILt0g AVPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WGe+uUYlDw+uG476SCRJ8n5xCAk3qfvXoM3VQJW7/IQ=; fh=5BXPZK1748bQSU/1KUky8kQhKMc4K8EWxa7ssteKdXg=; b=AeHkdlgw8lxubJMX/ZeD4hsCjw+eShLQ+uAcHvr7aAVfzF3DdYv+MXB82JlMJRWTCq auboJhhzVFwipJzqpZG+rEzqpuavL49+Ws9CsU3QKRmovVb6D+06LngpwNAEbLTezBE+ s6+Jy64BejpOQkcoOiYLtDsE9yG8X7CrtOkl5WGtOwn9BQQt+a7dB0c9q5hb7818Dv0e MGBQmEjcKmIWE+WN+90MnnPFYIPSxwv9DfAvYvvcUKavrJ/WpMyWgt4F2osT08FlMC8r w+vl3s1Xck/WLbhnid6urm/TWWhePOmdVDWU4L3iaAfuJIUS19ftsHL1kkDOAYh1yBwK Tu/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=qYY7+BPW; spf=pass (google.com: domain of linux-kernel+bounces-12-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h18-20020a17090aa89200b00285b8197a32si13039272pjq.167.2023.12.14.11.26.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 11:26:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=qYY7+BPW; spf=pass (google.com: domain of linux-kernel+bounces-12-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B2C222830A8 for ; Thu, 14 Dec 2023 19:26:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE7CD6978D; Thu, 14 Dec 2023 19:26:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="qYY7+BPW" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7D046978A for ; Thu, 14 Dec 2023 19:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d367e7092eso9325865ad.0 for ; Thu, 14 Dec 2023 11:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1702582004; x=1703186804; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WGe+uUYlDw+uG476SCRJ8n5xCAk3qfvXoM3VQJW7/IQ=; b=qYY7+BPW3giEoiFFZ2cP/+HW+VGTFB549jonZLeyDlOeO7gHbgv32VrpOXRFUErtWi y3UuH4hif6Xjx9VnwQXGrDCytMvka4qbJKVj4VVPqdqjTicUfjtIkxJ+HQIMouqiUe7s hW/o0k12cyD0pf51qJfLElb/jWFMX9edVU8Pdcf2uBUcKTkf44AyXFgAmxzFP14qRwCF 4vp/yJVXpdKk/4Mgk2hNpoizXGbfnKykEeOBkt5Qi2AWPgHGPPamKdzYTIy91S1Vrbpl B1t8T9TMb8jJCgPigccbpaD/GerA4+dkbO5UZn1FZAvCSUv3Nh7lVanyheMeHDyCGubq v+kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702582004; x=1703186804; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WGe+uUYlDw+uG476SCRJ8n5xCAk3qfvXoM3VQJW7/IQ=; b=hg8QIjGok+w/0jiO8PDGYZBm+M/y49BakYULSwi6SwOAof+FeSQUBf4B92Qu33OxaY Lmu1ekPO4K+fK0jrLFQpVmU9DotGnbeNXiIF7zNuWeFBTaULtz92+QSnF5S2EFY1XCXy eCuQYHSLpE5gnHoG3AnNBESKgPmglvcScK3+ZM79lW7yplqcMKVL2rrhdXcQO8f7hnzs eqEXrgadJBbbv8ZXrfO5SXGwjv7hQ6bwKrAjYWsoWLt9SpNKqX+0a6kYX6LZ9jQGqxXI 1suWCIWl3XQPRuGoYEWzQUkE/30Nx9K5z70G+H5lRsiyWBLgYcem2O2plNGCBU/UscVo uWKQ== X-Gm-Message-State: AOJu0Yx4bZa4/W0Pl/F6Vnn+WQ1T8DC/w36IYaYW1sA+p1tnzbj7ZaY1 u2Cr0bYkrm5ABmtqpiV4GAdxbA== X-Received: by 2002:a17:903:496:b0:1d3:752a:f4ab with SMTP id jj22-20020a170903049600b001d3752af4abmr877729plb.79.1702582004021; Thu, 14 Dec 2023 11:26:44 -0800 (PST) Received: from ghost ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id ja6-20020a170902efc600b001d1c96a0c66sm2564197plb.130.2023.12.14.11.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 11:26:43 -0800 (PST) Date: Thu, 14 Dec 2023 11:26:40 -0800 From: Charlie Jenkins To: Dan Carpenter Cc: oe-kbuild@lists.linux.dev, lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Palmer Dabbelt Subject: Re: arch/riscv/kernel/module.c:639 process_accumulated_relocations() error: uninitialized symbol 'curr_type'. Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 14, 2023 at 11:00:46AM +0300, Dan Carpenter wrote: > On Wed, Dec 13, 2023 at 11:27:02AM -0800, Charlie Jenkins wrote: > > > 8fd6c5142395a1 Charlie Jenkins 2023-11-01 638 } > > > 8fd6c5142395a1 Charlie Jenkins 2023-11-01 @639 reloc_handlers[curr_type].accumulate_handler( > > > ^^^^^^^^^ > > > Can the list be empty? Uninitialized in that case. > > > > That's a tricky one, the list cannot be empty. Each bucket in the > > bucket_iter is guarunteed to have at least one rel_entry. I can probably > > resolve this by extracting this for loop into a do-while loop. > > You can just ignore false positives. It's not really a fix to change it > to a do-while loop. I reviewed the do while code before reading this > email and I still wondered about empty lists, but just to hear that it's > not going to be empty is enough. Just the email was sufficient. > > regards, > dan carpenter > The freeing was actually broken so that needed to be fixed and I figured that it was worthwhile to include the do-while in the same patch to get rid of the warning. - Charlie