Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp597044rdh; Wed, 7 Feb 2024 14:08:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZir03alUkJx6wCpj5j5RMU3ECGkwRWfkeGx0TGnJJCyvdmHyWOhIDSQR78DTJ92mJhtMa X-Received: by 2002:a05:620a:1121:b0:785:403b:7abb with SMTP id p1-20020a05620a112100b00785403b7abbmr7181707qkk.11.1707343733234; Wed, 07 Feb 2024 14:08:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707343733; cv=pass; d=google.com; s=arc-20160816; b=j6Ml5JLAGUDzR1OFrK91ChYINkngWmb0VWJhSDQczlT5dRSUZ1rGaXNy2dYoAnbgW5 SerqONvMsJ9JKDiz07W0kAzstj1TRiksdlrmty8bNLi6FeMFckK+LVzA/PoQM3JlaknX uRz/34UB+hFtG4O+ygJCXSa0BcwkG+rwMB6+xAykB9CO1m5nBeziz8vshL8awBG+bMbl Dp7r3vuHLP7eqaHuQNHK3HZ17567sRKcN9+QWTYQiIh2VJ+MP4KaquJwTsOesmyA1qRc 4O/hqUrKy0PXSR7AkPO8CP41pQZok2DcC6fPEQ5rAWi5weXJQRQEbWoDTEdxyk6ehBvn axyA== ARC-Message-Signature: i=2; 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:sender:dkim-signature; bh=jY7jlxemTvyAAOoBoDUnhvdei8qq3JR7h5T3KXgL/2E=; fh=emUoAPRImcN73A/AqyT2ZM27frYekQIVpn6BE/qF8DQ=; b=eUty78oPcJ8ESWlaTgn3UDnJB7ebpwS+DDJe+1dQ8FAqVp0UrVKTJ5HkRBFmo67q1+ kgkE1SCHf4VHCnblCUTQa7qmlYzpjLuzREqt5YU0gRzvDZqOX9NTe7BQbT7v9fMIOVeo XAnlZ6mmwINcSraQQnxaaMIgN6u1ORlvg03gO40/f0jpHCi+PIMpTDEgd/5S1EQfejMN 0b6rOiPGYjZwd50fk1rZp2XfnlhxwpM4CV6sOjbp0i5kOVtJoZXEqtwnBU5cKoMkWla9 llB6Qd3sugdfibQ48/aR/f6FiNSA5oIjaTDgfvp9yx3dV/X4C/KyQH5x3SWe9wxVaxk1 KQsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YWFJeGWk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-57234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57234-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWs6bGUyD/WC3WrsTAWn6n0sXVypZ7Hi6gLWrAtm3yGsUyyF2NTwvk1P+7A29r5txEN5fj92IvDN9jIM2Qt1gzCciT3OVdaXkx325bMtw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bk5-20020a05620a1a0500b007858ce6296csi2305434qkb.541.2024.02.07.14.08.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 14:08:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YWFJeGWk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-57234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57234-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 024A71C257F1 for ; Wed, 7 Feb 2024 22:08:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC33C137C30; Wed, 7 Feb 2024 21:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YWFJeGWk" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 474B412BEA4; Wed, 7 Feb 2024 21:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707341547; cv=none; b=QtfG/LWwh5a9G44xFiYq2EvixZaZcTEZ7wLPmAWqXxpqf3xhufu9km9gT3ARlhmY1X0tJ+S+VPuu7LvPJFrvnBhB8JAqjyTS072Dbl2OjZCQIBZSlFvJ2rGNGIfwc7uR5P+9d1av6/Dophsd+ve+XAFDu1rZIGFauaq+1KE/7xY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707341547; c=relaxed/simple; bh=9+hKGsDihNv76nJokNTTmBYkhDtrKwveNJLjYVSzZkk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n3ZX+ZkGhe3WnlZpqCuiJaS6ZiaDAr+v1kPxbXJhR281PNO8hFPWam7Hjs8sCVZ23p1xsL6MXZFLUEWudnxvtcV83sDa/GFyDNJoVsd5jD/9wlrXQ4MzkNq99OGk3JxERTY6lEn0zSzYFL76PkbfNLIDShBzSRJaELfRmKvPFIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YWFJeGWk; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1d8aadc624dso9222885ad.0; Wed, 07 Feb 2024 13:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707341545; x=1707946345; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=jY7jlxemTvyAAOoBoDUnhvdei8qq3JR7h5T3KXgL/2E=; b=YWFJeGWkLzNxtOnGj4OgLaHImAC2XqZ8ZcZq8+FZcfxyERqUW0pSi9GVOZw2hwgJt0 f+4ElotY09o8tD5NkLhypQH+IMZ0sYs6XYOn/gDqsUFtfBwU5YLx05VyWhBsqaTsuzpS mEG7gudmydEdrhm66oTcVh2xx/eqDCEtjYhqjDp8eklkZLQpWIqvfpPdelC9KYJ96LoS Hm9NYjuqKFL04jamLG7upflY7r86hGkeqzy8JO9yImABh+QUCPUtVb2ch2lgXJ6tEBvO vJUTQiR7+jVRleJTrs9l3n5pCBs/3tRiwWieMj7ecYbxrn5NdIz4ggkwiv3j9iC7oJ3w vo5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707341545; x=1707946345; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jY7jlxemTvyAAOoBoDUnhvdei8qq3JR7h5T3KXgL/2E=; b=d9lkvQOhu8nT6AsEb45hrANytE10GtSBFiBE0IQ1rwTCc64n9B1pX3QahUNFlUSU6X YCsuQh9KKGEc9/szFP9QLylqmbV/Usiip3DIV/UpQgQcEcDQfkKA8BbbRPmABVo/IByF cuS7PQfwe43stDy4oWaS2oGBPco6WAGbI468WV0x2kjP1UwEACI19s7QQ3tVP1fsfg10 6auZZze+Qf2AjLVsEkSx2WnZATRSly/ednFrell37O8iAXCie1RyDx4CI9aaAiLyqdfn ByBpw2CfBAcJqR4L/PDfNphYXq0k12CogPU+x/qLkaObiopVznO30AD+OiDtRIijt10S FcHQ== X-Gm-Message-State: AOJu0YyW9qYzZuOzDJ4Et5hE8efNvY4dTS2YvAzOD0OEHD+sLmUyZixj U8j47a9x9CjXGM1cyCE+b0wgnBi9G5Oltr56CDoBMHgC3fCNWJyBVjhsg9Ps X-Received: by 2002:a17:902:ecd1:b0:1d9:b739:a5aa with SMTP id a17-20020a170902ecd100b001d9b739a5aamr7894981plh.42.1707341545518; Wed, 07 Feb 2024 13:32:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV/QaLoKYQVEUZJ+d4/DtkBarJQM/cmfjbixgE5MqU2ZGTFPHg1L6NNDTMl/ybSe2s96nt7YEFjYmffpSj+k32a6Om/dPFpvxFAtNOECt2YWp0i8tu9zdnsszUz7+psCxSHSaZWNjzAuj9ucA403cKmCKTyw2+2Uz+hepsAKmSjLrCgzQ== Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h9-20020a170902f2c900b001d910f0ac3bsm1945231plc.246.2024.02.07.13.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 13:32:25 -0800 (PST) Sender: Guenter Roeck Date: Wed, 7 Feb 2024 13:32:24 -0800 From: Guenter Roeck To: Javier Carrasco Cc: Jean Delvare , Dan Carpenter , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] hwmon: chipcap2: fix return path in cc2_request_alarm_irqs() Message-ID: References: <20240207-chipcap2_init_vars-v1-0-08cafe43e20e@gmail.com> <20240207-chipcap2_init_vars-v1-2-08cafe43e20e@gmail.com> 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: <20240207-chipcap2_init_vars-v1-2-08cafe43e20e@gmail.com> On Wed, Feb 07, 2024 at 10:17:09PM +0100, Javier Carrasco wrote: > The return path can be improved by returning upon first failure. The > current implementation would try to register the second interrupt even > if the first one failed, which is unnecessary. > > Moreover, if no irqs are available, the return value should be zero > (the driver supports the use case with no interrupts). Currently the > initial value is unassigned and that may lead to returning an unknown > value if stack variables are not automatically set to zero and no irqs > were provided. > > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/linux-hwmon/294e4634-89d4-415e-a723-b208d8770d7c@gmail.com/T/#t > Signed-off-by: Javier Carrasco Applied. Thanks, Guenter