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=1796380264; b=oQ4CLc7VwDvrrhcVXol7qDMmivJbXGorRzcWYC/vXPnESFBhsy6WmtR8vZjPJR1Q7PiG em3/hXuhauVc+PkhL35XPFcGzf7bY8NBbLVKjWyi9B3fYwlUGZ92FVdZr4b5V6Ypbkt5f 0hHelg8sHO84dUUA6dcddpw4H9SR3bdzcuq+xLyC0+wAX9KglGSKnNmhn6dJ6usT/Jubj 4PJJ4GvQRxq6tkVdPc2MZV39h5gKz3qBNfmDuKXI53/HNf5Z7UFkT/+au7BAEVLA5gSO4 g8/aCkWVhvLkh74dOIynhYoh7N3/Y3lYacBkipgrLah2dj7wTCRHrt6aoZCZnG22TaQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380264; 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=mwn4r5ZZph+lJGF/s0F3C5uFwORAergz/ftQIStrowI=; b=k0dKiAC+FnSZlBp+JfvX0UTUdC7VlkLedZtvNIvo3ympoAUdN4jE3R+x4BjOkvRjzict SPK2O5T3/EBcCCIimXBVYmckWE4GxTZB35FShxKNKHhHYcyNs8tgcDUNd1Wkecyjt7GZk 0+BowKvQoErFv+rYaFY3ZudFkpxHw25W8rnih2V9CdRprubRJjNevpEJEzmrAAVS0Ofef O9dKpXYN83knzUkYfETmuPhlyL7iFtHvNW3cdb7RwoBkVbbBGyRjJOKy/1O9at8KilnGa vmstG221u7wSM4LbiB19fda8Vn0a1rM516muQgogyNVstZVKkcaa+mbH9JLAWNG3bJA== 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=2pxuyCnz; 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 3C841606A32C; Fri, 4 Dec 2026 10:31:04 +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=2pxuyCnz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 975B41F000C2; Fri, 4 Dec 2026 10:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380264; bh=mwn4r5ZZph+lJGF/s0F3C5uFwORAergz/ftQIStrowI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2pxuyCnzjFzKq2gg5bqiLG5sDh7x2RKVtCYkdRQ1D8OWvdIvEiToHAYUEbFJf9CTD U9n1zlUtMayOjC6xaJciUtPtLekwZzl8lw+Z7FZtmwlsaChOGKYl/4jOaTvP+3ZleE GB5IRIeM2HZicVWHUByKkT2wZncz8508yoU6qiwE= 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 7.3 198/742] tools: gpio: Return success after monitoring requested events Date: Fri, 4 Dec 2026 19:01:02 +0900 Message-ID: <20261204100640.348377379@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 b70813b0bf8ef..af223e254bc98 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