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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ipaq-micro-ts - use guard notation when acquiring mutex/spinlock

Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+2 -6
+2 -6
drivers/input/touchscreen/ipaq-micro-ts.c
··· 47 47 { 48 48 struct ipaq_micro *micro = ts->micro; 49 49 50 - spin_lock_irq(&micro->lock); 50 + guard(spinlock_irq)(&micro->lock); 51 51 52 52 if (enable) { 53 53 micro->ts = micro_ts_receive; ··· 56 56 micro->ts = NULL; 57 57 micro->ts_data = NULL; 58 58 } 59 - 60 - spin_unlock_irq(&ts->micro->lock); 61 59 } 62 60 63 61 static int micro_ts_open(struct input_dev *input) ··· 131 133 struct touchscreen_data *ts = dev_get_drvdata(dev); 132 134 struct input_dev *input = ts->input; 133 135 134 - mutex_lock(&input->mutex); 136 + guard(mutex)(&input->mutex); 135 137 136 138 if (input_device_enabled(input)) 137 139 micro_ts_toggle_receive(ts, true); 138 - 139 - mutex_unlock(&input->mutex); 140 140 141 141 return 0; 142 142 }