Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: synaptics-rmi4 - use guard notation when pausing serio port in F03

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.

Link: https://lore.kernel.org/r/20240905041732.2034348-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+2 -2
+2 -2
drivers/input/rmi4/rmi_f03.c
··· 61 61 struct f03_data *f03 = dev_get_drvdata(&fn->dev); 62 62 struct serio *serio = f03->serio; 63 63 64 - serio_pause_rx(serio); 64 + guard(serio_pause_rx)(serio); 65 + 65 66 if (serio->drv) { 66 67 serio->drv->interrupt(serio, PSMOUSE_OOB_EXTRA_BTNS, 67 68 SERIO_OOB_DATA); 68 69 serio->drv->interrupt(serio, f03->overwrite_buttons, 69 70 SERIO_OOB_DATA); 70 71 } 71 - serio_continue_rx(serio); 72 72 } 73 73 74 74 static int rmi_f03_pt_write(struct serio *id, unsigned char val)