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: libps2 - embed WARN_ON(1) macros into their enclosing if statements

Make WARN_ON(1) statements embedded inside their respective 'if' expressions,
to improve code clarity.

Signed-off-by: Max Brener <linmaxi@gmail.com>
Link: https://patch.msgid.link/20260214203725.6463-1-linmaxi@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Max Brener and committed by
Dmitry Torokhov
6075dd69 ab2e361c

+3 -9
+3 -9
drivers/input/serio/libps2.c
··· 154 154 */ 155 155 void ps2_drain(struct ps2dev *ps2dev, size_t maxbytes, unsigned int timeout) 156 156 { 157 - if (maxbytes > sizeof(ps2dev->cmdbuf)) { 158 - WARN_ON(1); 157 + if (WARN_ON(maxbytes > sizeof(ps2dev->cmdbuf))) 159 158 maxbytes = sizeof(ps2dev->cmdbuf); 160 - } 161 159 162 160 ps2_begin_command(ps2dev); 163 161 ··· 268 270 int i; 269 271 u8 send_param[16]; 270 272 271 - if (receive > sizeof(ps2dev->cmdbuf)) { 272 - WARN_ON(1); 273 + if (WARN_ON(receive > sizeof(ps2dev->cmdbuf))) 273 274 return -EINVAL; 274 - } 275 275 276 - if (send && !param) { 277 - WARN_ON(1); 276 + if (WARN_ON(send && !param)) 278 277 return -EINVAL; 279 - } 280 278 281 279 memcpy(send_param, param, send); 282 280