Linus Torvalds aa50be9cd5 Use the right type for sanitize_sensor_id()
It returned a 'uint8_t', which clashes pretty badly with NO_SENSOR being
-1, and turned it into 255.  That then ended up historically working,
because before commit 0c84f369c35b ("core: use int16_t for sensor-id")
we actually did that everywhere:

 #define NO_SENSOR ((uint8_t)-1)
 ...
    uint8_t sensor[MAX_SENSORS];

but that was changed to

 #define NO_SENSOR -1
 ...
    int16_t sensor[MAX_SENSORS];

and this helper type became wrong.

Just make it return 'int', avoiding any type narrowing issues.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-09-20 09:41:35 -07:00
..
2022-08-30 07:20:33 -07:00
2022-08-25 13:38:12 -07:00
2017-04-29 13:32:55 -07:00
2020-10-24 09:51:37 -07:00
2021-07-23 11:22:43 -07:00
2020-09-29 16:13:03 -07:00
2021-10-01 08:50:36 -07:00
2021-10-01 08:50:36 -07:00
2021-07-23 11:22:43 -07:00
2021-07-23 11:22:43 -07:00
2018-10-21 19:55:09 +03:00
2022-03-13 15:07:33 -07:00
2022-03-12 08:28:32 -08:00
2021-07-23 11:16:00 -07:00
2019-12-13 07:04:00 -05:00
2017-04-29 13:32:55 -07:00
2020-03-10 17:42:54 -07:00
2020-03-10 17:42:54 -07:00
2020-05-03 15:02:21 -07:00
2022-06-04 14:19:05 -07:00