Message ID | 20240905041732.2034348-6-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 6A716CD4F56 for <linux-arm-kernel@archiver.kernel.org>; Thu, 5 Sep 2024 04:23:43 +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=S0EXapSSsCRGMYSuYgIhJLIKriJqRLmvnrfU3aGsX6c=; b=UnLe3FlrNZt5VPu9FhxLfWeTQv inlAaDQ7xfll07efM3X8AG6sn4zdEqGio96R0A78aSbz3qut1P/7deE+e5jEZjMtIa6SZz0QL7ck0 pAq9E5hKy6xVpZVgx0p5/c+e7IM6FbYeRGhQiRupbQd3K949OrHjHYER/CAXBb6ibZqyqtFbQQy1t 3DvJp7+cbyWB7iPzbzY/wVEtVbPgzaBWL9UZQkE+OL8Ncmp+FWkyS8A6ayQqtdpYJakE4vSo1Ya+v LWDuQUgKs/vh7GWcXj2tnU+d6B/T5NvkAW0CIaQKZSSktoVtr6sNM3OWvu5oiinTe6elo1kTYIOiE JBL8zCVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm41v-00000006v2Z-0ajL; Thu, 05 Sep 2024 04:23:35 +0000 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm3wO-00000006tN2-1pZ4 for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 04:17:53 +0000 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3df07543ed5so235775b6e.0 for <linux-arm-kernel@lists.infradead.org>; Wed, 04 Sep 2024 21:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725509871; x=1726114671; 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=S0EXapSSsCRGMYSuYgIhJLIKriJqRLmvnrfU3aGsX6c=; b=WoXbGuHrhpC2MoEbA1n0h8KeMqBDEQ68/kySpw8c2a/J1nVviTZ+oJFBi8w1D5+zw6 PKVRT2w1u+1gTUV+R2AqBu+v0mYkHFUl94ap/VKSrCILdxBVvXCrW6xJ/0ZbcBbjYrjp +vwPDe2d2qsRn95VdyhPV0AOzVUx1pjEkszmt66GBzRZNQJbPed045ulr7D/+3EKVQZI Qu5jqLI+Po8QaWVH40UYQbsgyok49l/e1s4Dfl5lWUI7Z8Sy+5pfDaWFVDi2zaz4AnAZ x4bsIZaLV1No+TwlRKogQEbAaDdKwEppDlfq4WU1bUSoGFvo/zv6U2+b+YlPPtpasX7f L8NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725509871; x=1726114671; 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=S0EXapSSsCRGMYSuYgIhJLIKriJqRLmvnrfU3aGsX6c=; b=D7iacao++7WhxqxuVabR8G3H8ntjbNhEC0StNZBHC4ZooxY9s/+qQ9iTmvRNYb0Hff 7j8Fu9vWotzjpuYnPYGcGXZBGkXJt3Of/5Ypv6gMEQfgE6/FFhFb6UjgO6eycGIe5XRd mJOnFJoh17K6J86sfF20QfLo9ko0Q7Em6lPd0bLHr3mRpBrz4LW9ZwYA5MnMMQDTklPr o1ZmfNde3ogvwMM8ZuZi2w6V34Za0889GGooRfNuHFVrkIbmjHI7JToxZDp3l7Kf2CzB /e+IsS4Dx5VGN1KwqQ04U+vZYDnm309+COxEJdvhuQcA6pp6TYFI5WfGK4eacCCz1vGS Z/hw== X-Forwarded-Encrypted: i=1; AJvYcCWsXc3ZgKIS38rLT2tszjtteWqfEsYUiNGy4QJ7btyGyTQDu0W1RLScdFVH5DETclia6OOZf5mKsiGJqFnJXZMa@lists.infradead.org X-Gm-Message-State: AOJu0YwmeSdMlnM3oXjgSk2V7boNw7sVGVnfK9T3FsGFF5+Ta81ZcMXa uR9+SZKnYJlwkL44fFhcydsLk2+ooaH/uWTFiCgiywBSqnA9kh2L X-Google-Smtp-Source: AGHT+IGhPGvVxRbF3Iu8u5rEKkCm3Ue+quK2XnAYIQLdPlMcym1uORvuIvaEIla7+lCAvI2New5hng== X-Received: by 2002:a05:6808:3197:b0:3da:aae9:7182 with SMTP id 5614622812f47-3df1d5b87b5mr19628930b6e.2.1725509871047; Wed, 04 Sep 2024 21:17:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 21:17:50 -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 05/24] Input: synaptics - use guard notation when pausing serio port Date: Wed, 4 Sep 2024 21:17:10 -0700 Message-ID: <20240905041732.2034348-6-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_211752_571667_13A41CB5 X-CRM114-Status: GOOD ( 11.00 ) 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/synaptics.c b/drivers/input/mouse/synaptics.c index 380aa1614442..2735f86c23cc 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -650,9 +650,8 @@ static int synaptics_pt_start(struct serio *serio) struct psmouse *parent = psmouse_from_serio(serio->parent); struct synaptics_data *priv = parent->private; - serio_pause_rx(parent->ps2dev.serio); + guard(serio_pause_rx)(parent->ps2dev.serio); priv->pt_port = serio; - serio_continue_rx(parent->ps2dev.serio); return 0; } @@ -662,9 +661,8 @@ static void synaptics_pt_stop(struct serio *serio) struct psmouse *parent = psmouse_from_serio(serio->parent); struct synaptics_data *priv = parent->private; - serio_pause_rx(parent->ps2dev.serio); + guard(serio_pause_rx)(parent->ps2dev.serio); priv->pt_port = NULL; - serio_continue_rx(parent->ps2dev.serio); } static int synaptics_is_pt_packet(u8 *buf)
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/synaptics.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)