Message ID | 20240905041732.2034348-5-dmitry.torokhov@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A632DCD4F55 for <linux-arm-kernel@archiver.kernel.org>; Thu, 5 Sep 2024 04:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8RnFN3EVlk3VoY/i2sKWDmOIShT35NS9PrPlyqQEJBY=; b=K61LzfLAQaIlWmnXWuZSf/fPUm qDtcYlUFCWvV/kblGI0EzBp4eaw/UgP8qdRDI6UGFbhYCsPiSdoaiV/obDe/JFWe/bViyVoBkygBo AEhCoFK/BuJKjV6YjOCUKeUgyFd+7fiKcHxU1B5D6O7isUvp1eVn8Ro0IYGwMJWy8Kj0SQh0Yd5KC /rKSvqiuSIIhdAufv1pxPFKLMJcFdeHhBPocKBxOA9bGmeMMOJs8Acy5dlQQQvfsYuP1F4kNtL7G2 0VJxglTbJZQss7EqXSYTtfznBPreILdPI8qj5MZ+YHzhsmqDl7JC/pftwsSjnkjsR4+6CYtvMpbn7 virujX9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm40z-00000006ulV-1K93; Thu, 05 Sep 2024 04:22:37 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm3wM-00000006tM7-3mQ3 for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 04:17:52 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-70f79f75da6so241684a34.0 for <linux-arm-kernel@lists.infradead.org>; Wed, 04 Sep 2024 21:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725509870; x=1726114670; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8RnFN3EVlk3VoY/i2sKWDmOIShT35NS9PrPlyqQEJBY=; b=bDo3GwdP+PeYPqjf+tWWeUZ9pJEn5Ke+WSjxpXEqcCNqCkQAhNOSma+jbpv4cTVBNM ZFS/lptSTNM/mOuDbO6Tr+rKB5qVJvbNhQahO0HINs8rpQRSyFE8lbbNfhtmjOoOqBQ3 +wykYVfpexXeypi45YgtJyt0wgjQipKy4JCB4aJC7oe8i1O5Vm8MfsDDw5B4dU7lycLf v4Rqra5AHgXOPxqn0BMTqpgLkcORzV0nSK1h8I2W1rurHMuwXgX1Z5ccJNEglICaRgik zJFATP3cQcGynU+d68wsnykk7wJ/3jQ9KKIdeoMh73PZNZdYGWZiHibJ1jCzLCbgbOkU 79HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725509870; x=1726114670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8RnFN3EVlk3VoY/i2sKWDmOIShT35NS9PrPlyqQEJBY=; b=ZJ99Mmc2EE0eGh9xjdgLYEYaX/gLRrkLFVpUsGRrtc6NDmG3xxe+/fRTd3XiWchSul xPuUJzFAx5ls8kxz69vbBSmZSv4MTwDqHxdPYwXkA4gWOZYhjh4E6z8+R+nM0D/5yBa5 +uGdX7OkQ1mxPTvf5D+Updww//HMxl5nLy2ERQ80G0YCSEqm1gC83aFUK8PO0qJ04qXA I8f2QgzqOmjjRhpr442itCuWrYthpX0r5sJpxbjX7nLkrALbA+JM+LzIQvvhz5taDaTg ETrTFaQJnAJ3FeWkwRUUNUmGKgM6gSsaoUvQvmHN3UVsaFCD+87F8QNynQU4RYZVgOjw CzWg== X-Forwarded-Encrypted: i=1; AJvYcCUR8cns0/7qcLARiYfKZCQX5d9OB3Pzl+TpMwD4QZN4wGdpSAa172aRzWpD640JhjdZPG/2WZJy1RUp8JrS9CKo@lists.infradead.org X-Gm-Message-State: AOJu0YwDDsJkF7BI3nCjCU1MndseBTxXhgkqRy9+k1eyqpCK8wJVEcpI Ybu+H5yoQIn5ukFb68Lg6esI3MN9JAYE2OUVB9CvMJ99+4M44ycI X-Google-Smtp-Source: AGHT+IErwMioNhwmn1dsG6jz5WUbE6Tfb09I0yh8Z59wc3+setGX3kYdpiz4wU4pA3/BcQ951wC+fg== X-Received: by 2002:a05:6830:2709:b0:70d:f448:575c with SMTP id 46e09a7af769-70f706e362amr17541035a34.7.1725509869713; Wed, 04 Sep 2024 21:17:49 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2620:15c:9d:2:13bd:b4e:4c0f:4c37]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7d4fbd8d52esm2450216a12.32.2024.09.04.21.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 21:17:49 -0700 (PDT) From: Dmitry Torokhov <dmitry.torokhov@gmail.com> To: linux-input@vger.kernel.org Cc: =?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>, Helge Deller <deller@gmx.de>, "K. Y. Srinivasan" <kys@microsoft.com>, Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Samuel Holland <samuel@sholland.org>, Lyude Paul <thatslyude@gmail.com>, Michal Simek <michal.simek@amd.com>, Hans de Goede <hdegoede@redhat.com>, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH 04/24] Input: byd - use guard notation when pausing serio port Date: Wed, 4 Sep 2024 21:17:09 -0700 Message-ID: <20240905041732.2034348-5-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog In-Reply-To: <20240905041732.2034348-1-dmitry.torokhov@gmail.com> References: <20240905041732.2034348-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_211751_003412_11ECB6D4 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Convert serio-related drivers to use new cleanup facilities
|
expand
|
diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c index 221a553f45cd..654b38d249f3 100644 --- a/drivers/input/mouse/byd.c +++ b/drivers/input/mouse/byd.c @@ -254,13 +254,12 @@ static void byd_clear_touch(struct timer_list *t) struct byd_data *priv = from_timer(priv, t, timer); struct psmouse *psmouse = priv->psmouse; - serio_pause_rx(psmouse->ps2dev.serio); + guard(serio_pause_rx)(psmouse->ps2dev.serio); + priv->touch = false; byd_report_input(psmouse); - serio_continue_rx(psmouse->ps2dev.serio); - /* * Move cursor back to center of pad when we lose touch - this * specifically improves user experience when moving cursor with one
Using guard notation makes the code more compact and error handling more robust by ensuring that serio ports are resumed in all code paths when control leaves critical section. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/input/mouse/byd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)