[PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance()
From: Dmitry Torokhov
Date: Fri Nov 13 2026 - 19:02:44 EST
The resistance value is already bounds-checked against U32_MAX before
returning from a function returning u32, so the explicit cast is
unnecessary. Drop it.
Suggested-by: Andy Shevchenko <andy@xxxxxxxxxx>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/touchscreen/tsc2007_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
index 7660504f58ff..fc707e672424 100644
--- a/drivers/input/touchscreen/tsc2007_core.c
+++ b/drivers/input/touchscreen/tsc2007_core.c
@@ -82,7 +82,7 @@ u32 tsc2007_calculate_resistance(struct tsc2007 *tsc, struct ts_event *tc)
if (rt > U32_MAX)
return U32_MAX;
- return (u32)rt;
+ return rt;
}
bool tsc2007_is_pen_down(struct tsc2007 *ts)
--
2.56.0.679.gc527c65306-goog