Linux Input/HID development
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/24] Input: alps - use guard notation when pausing serio port
Date: Thu, 5 Sep 2024 17:46:26 +0200	[thread overview]
Message-ID: <20240905154626.kws5h3s5tca2uaqd@pali> (raw)
In-Reply-To: <20240905041732.2034348-4-dmitry.torokhov@gmail.com>

On Wednesday 04 September 2024 21:17:08 Dmitry Torokhov wrote:
> 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>

Looks good for me.
Acked-by: Pali Rohár <pali@kernel.org>

> ---
>  drivers/input/mouse/alps.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 4e37fc3f1a9e..0728b5c08f02 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -1585,7 +1585,7 @@ static void alps_flush_packet(struct timer_list *t)
>  	struct alps_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);
>  
>  	if (psmouse->pktcnt == psmouse->pktsize) {
>  
> @@ -1605,8 +1605,6 @@ static void alps_flush_packet(struct timer_list *t)
>  		}
>  		psmouse->pktcnt = 0;
>  	}
> -
> -	serio_continue_rx(psmouse->ps2dev.serio);
>  }
>  
>  static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
> -- 
> 2.46.0.469.g59c65b2a67-goog
> 

  reply	other threads:[~2024-09-05 15:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05  4:17 [PATCH 00/24] Convert serio-related drivers to use new cleanup facilities Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 01/24] Input: serio - define serio_pause_rx guard to pause and resume serio ports Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 02/24] Input: libps2 - use guard notation when temporarily pausing " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 03/24] Input: alps - use guard notation when pausing serio port Dmitry Torokhov
2024-09-05 15:46   ` Pali Rohár [this message]
2024-09-05  4:17 ` [PATCH 04/24] Input: byd " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 05/24] Input: synaptics " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 06/24] Input: atkbd " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 07/24] Input: sunkbd " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 08/24] Input: synaptics-rmi4 - use guard notation when pausing serio port in F03 Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 09/24] Input: elo - use guard notation when pausing serio port Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 10/24] Input: gscps2 - use guard notation when acquiring spinlock Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 11/24] Input: hyperv-keyboard " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 12/24] Input: i8042 - tease apart interrupt handler Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 13/24] Input: i8042 - use guard notation when acquiring spinlock Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 14/24] Input: ps2-gpio - use guard notation when acquiring mutex Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 15/24] Input: ps2mult - use guard notation when acquiring spinlock Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 16/24] Input: q40kbd " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 17/24] Input: sa1111ps2 " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 18/24] Input: serport " Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 19/24] Input: serio - use guard notation when acquiring mutexes and spinlocks Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 20/24] Input: serio_raw - use guard notation for locks and other resources Dmitry Torokhov
2024-10-21 20:41   ` Kees Bakker
2024-09-05  4:17 ` [PATCH 21/24] Input: serio-raw - fix potential serio port name truncation Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 22/24] Input: sun4i-ps2 - use guard notation when acquiring spinlock Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 23/24] Input: userio - switch to using cleanup functions Dmitry Torokhov
2024-09-05  4:17 ` [PATCH 24/24] Input: xilinx_ps2 - use guard notation when acquiring spinlock Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240905154626.kws5h3s5tca2uaqd@pali \
    --to=pali@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox