linux/drivers/input
Justin Stitt 68ede283a1 Input: axp20x-pek - avoid needless newline removal
This code is doing more work than it needs to.

Before handing off `val_str` to `kstrtouint()` we are eagerly removing
any trailing newline which requires copying `buf`, validating it's
length and checking/replacing any potential newlines.

kstrtouint() handles this implicitly:
kstrtouint ->
  kstrotoull -> (documentation)
|   /**
|    * kstrtoull - convert a string to an unsigned long long
|    * @s: The start of the string. The string must be null-terminated, and may also
|    *  include a single newline before its terminating null. The first character
|    ...

Let's remove the redundant functionality and let kstrtouint handle it.

Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230925-strncpy-drivers-input-misc-axp20x-pek-c-v2-1-ff7abe8498d6@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-09-30 09:35:31 -07:00
..
gameport Input: gameport - add ISA and HAS_IOPORT dependencies 2023-07-05 17:32:34 -07:00
joystick Linux 6.4 2023-07-17 09:20:46 -07:00
keyboard Input: stmpe-keypad - convert to platform remove callback returning void 2023-09-23 19:16:42 -07:00
misc Input: axp20x-pek - avoid needless newline removal 2023-09-30 09:35:31 -07:00
mouse Input: navpoint - convert to platform remove callback returning void 2023-09-23 19:16:45 -07:00
rmi4 Input: synaptics-rmi4 - replace deprecated strncpy 2023-09-30 09:24:15 -07:00
serio Input: xilinx_ps2 - convert to platform remove callback returning void 2023-09-23 19:28:15 -07:00
tablet Input: pegasus-notetaker - check pipe type when probing 2023-04-09 19:19:14 -07:00
tests Input: tests - add test to cover all input_grab_device() function 2023-05-23 14:50:28 -07:00
touchscreen Input: wm97xx-core - convert to platform remove callback returning void 2023-09-23 19:28:17 -07:00
apm-power.c
evbug.c
evdev.c Input: evdev - annotate struct evdev_client with __counted_by 2023-09-30 09:24:16 -07:00
ff-core.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
ff-memless.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
input-compat.c
input-compat.h
input-core-private.h Input: deactivate MT slots when inhibiting or suspending devices 2022-07-20 11:35:13 -07:00
input-leds.c Input: leds - annotate struct input_leds with __counted_by 2023-09-30 09:24:16 -07:00
input-mt.c Input: deactivate MT slots when inhibiting or suspending devices 2022-07-20 11:35:13 -07:00
input-poller.c
input-poller.h
input.c Linux 6.4 2023-07-17 09:20:46 -07:00
joydev.c Input: joydev - fix comment typo 2022-09-25 00:57:25 -07:00
Kconfig Input: tests - modular KUnit tests should not depend on KUNIT=y 2023-05-02 10:39:00 -07:00
Makefile Input: Add KUnit tests for some of the input core helper functions 2023-04-01 22:47:04 -07:00
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c
vivaldi-fmap.c Input: extract ChromeOS vivaldi physmap show function 2022-03-14 21:11:09 -07:00