From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796386379; b=YJVboePuaofENRfLq1E14/mcMPyeVe1spPwKFxGGe57FLHQWL5QfvAIUbUqD53t53C2h 4p26tnWIXcYInuhe1jKZ/f5+IfAsIYFf59FTCi5Om7pKfAkLqEzPWInYK15H4HydTB0g3 WhSz8Y4fhxFNTpTXJPtz1b67Tv+C6OOjok2+QVa2IOpVCHOLmi8ckwBNR/Gr4GQYFW9QW bS42XI/l4r3OMyxZ5unj/Idip5SIzGZGnGeJ2g1+5CZd9YDXf3NRwa8ygv0U6oeyoXxr5 7AqjnbouHIKzqEuL7WK3eBUbgXrUK8xJMuM+HwexPdiJ9777h1wdDeCNRpQp2Elr0Pg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386379; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=GDeh/jVnSUOM6lX8sQfN9hc/v+WwWRxDgCtekaI3Vd0=; b=0PysyJj55YHuKQhLCAaNT8RvSeFPVXJDzW88+henUj+RgeTMkL1nEwQLec3u5jiQhOhU PQhKSO6W53vRJAbFjGt6REnqAoc45osj8du/dEp6WhNpcMlfEV9+fz0mhNGThoYgMiY80 uL2YYw9rTolSyFHxWbIEFb2p9Mv9Bw14/s+MXBrCMJv0JKGDedryLkhpHOyu2A+psgkZG ArPQP/gVA+cLlBMpcktSl6KlMS2zgkNkunuoqBbOqJmkqUJdwCbrnqescgmz01UlRcH2Z OZvuwNAezcVJKQ9H9Kx4X9AtPIqG0BOjUvIzXMuOCt9m0BufnLy5Hcs4pKI9izKFmLg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=TnaSK62D; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43936606A684; Fri, 4 Dec 2026 12:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=TnaSK62D Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AA381F00933; Fri, 4 Dec 2026 12:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386379; bh=GDeh/jVnSUOM6lX8sQfN9hc/v+WwWRxDgCtekaI3Vd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TnaSK62DrKxi0dTxHS/e8PUK9LJ6Iht5iygiqR35phYiLADK79207xpm7IB4AKoZd gnF8fAmInB8EODmNYsLVm9QA2srv4nRGLHeEtCXd3Aq3y9j1rckePimFMh7K+t1xXg +0WP0mgSWMPS+tO1Pttcvzs9TGb6fHldrpxuoR5E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhu Jun , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 6.6 0935/1167] tools: gpio: Return success after monitoring requested events Date: Fri, 4 Dec 2026 19:06:02 +0900 Message-ID: <20261204100726.546613632@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhu Jun [ Upstream commit 1eaf27d99938dd30ea7855174b65e37a2503a349 ] After reading the requested number of events, monitor_device() returns the positive byte count left in ret by read(). main() passes this value through as the exit status, so a successful invocation with -c reports failure. Clear ret when the event limit is reached, keeping read failures on their existing error paths. Fixes: 97f69747d8b1 ("tools/gpio: add the gpio-event-mon tool") Signed-off-by: Zhu Jun Link: https://patch.msgid.link/20261120062107.98391-1-zhujun2@cmss.chinamobile.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- tools/gpio/gpio-event-mon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c index 5dee2b98ab604..77807be4fc39b 100644 --- a/tools/gpio/gpio-event-mon.c +++ b/tools/gpio/gpio-event-mon.c @@ -124,8 +124,10 @@ int monitor_device(const char *device_name, fprintf(stdout, "\n"); i++; - if (i == loops) + if (i == loops) { + ret = 0; break; + } } exit_line_close: -- 2.53.0