mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance()
@ 2026-11-14  0:02 Dmitry Torokhov
  2026-11-14  0:02 ` [PATCH 2/3] Input: tsc2007 - use scnprintf() when formatting phys string Dmitry Torokhov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2026-11-14  0:02 UTC (permalink / raw)
  To: Andy Shevchenko, Svyatoslav Ryhel, H . Nikolaus Schaller
  Cc: Andy Shevchenko, Andreas Kemnade, Johannes Kirchmair, Yuki Horii,
	linux-input, linux-kernel

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@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-14  0:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14  0:02 [PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance() Dmitry Torokhov
2026-11-14  0:02 ` [PATCH 2/3] Input: tsc2007 - use scnprintf() when formatting phys string Dmitry Torokhov
2026-11-14  0:43   ` Andy Shevchenko
2026-11-14  0:02 ` [PATCH 3/3] Input: tsc2007 - drop redundant error message on IRQ request failure Dmitry Torokhov
2026-11-14  0:44   ` Andy Shevchenko
2026-11-14  0:43 ` [PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®