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

* [PATCH 2/3] Input: tsc2007 - use scnprintf() when formatting phys string
  2026-11-14  0:02 [PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance() Dmitry Torokhov
@ 2026-11-14  0:02 ` 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:43 ` [PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance() Andy Shevchenko
  2 siblings, 1 reply; 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

Use scnprintf() instead of snprintf() when constructing the physical
device path string to follow kernel string formatting conventions.

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 fc707e672424..d55034914808 100644
--- a/drivers/input/touchscreen/tsc2007_core.c
+++ b/drivers/input/touchscreen/tsc2007_core.c
@@ -252,7 +252,7 @@ static int tsc2007_input_configure(struct tsc2007 *ts)
 
 	ts->input = input_dev;
 
-	snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev));
+	scnprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev));
 
 	input_dev->name = "TSC2007 Touchscreen";
 	input_dev->phys = ts->phys;
-- 
2.56.0.679.gc527c65306-goog


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

* [PATCH 3/3] Input: tsc2007 - drop redundant error message on IRQ request failure
  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:02 ` 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
  2 siblings, 1 reply; 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

devm_request_threaded_irq() already logs an error message when
requesting the interrupt fails, so the additional dev_err() call in
tsc2007_input_configure() is redundant. Remove it.

Suggested-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/tsc2007_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
index d55034914808..3597f71f6c33 100644
--- a/drivers/input/touchscreen/tsc2007_core.c
+++ b/drivers/input/touchscreen/tsc2007_core.c
@@ -276,10 +276,8 @@ static int tsc2007_input_configure(struct tsc2007 *ts)
 					NULL, tsc2007_soft_irq,
 					IRQF_ONESHOT | IRQF_NO_AUTOEN,
 					dev->driver->name, ts);
-	if (err) {
-		dev_err(dev, "Failed to request irq %d: %d\n", ts->irq, err);
+	if (err)
 		return err;
-	}
 
 	err = input_register_device(input_dev);
 	if (err) {
-- 
2.56.0.679.gc527c65306-goog


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

* Re: [PATCH 1/3] Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance()
  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:02 ` [PATCH 3/3] Input: tsc2007 - drop redundant error message on IRQ request failure Dmitry Torokhov
@ 2026-11-14  0:43 ` Andy Shevchenko
  2 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-11-14  0:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andy Shevchenko, Svyatoslav Ryhel, H . Nikolaus Schaller,
	Andreas Kemnade, Johannes Kirchmair, Yuki Horii, linux-input,
	linux-kernel

On Sat, Nov 14, 2026 at 2:02 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> 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.

Reviewed-by: Andy Shevchenko <andy@kernel.org>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 2/3] Input: tsc2007 - use scnprintf() when formatting phys string
  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
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-11-14  0:43 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andy Shevchenko, Svyatoslav Ryhel, H . Nikolaus Schaller,
	Andreas Kemnade, Johannes Kirchmair, Yuki Horii, linux-input,
	linux-kernel

On Sat, Nov 14, 2026 at 2:02 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Use scnprintf() instead of snprintf() when constructing the physical
> device path string to follow kernel string formatting conventions.

Reviewed-by: Andy Shevchenko <andy@kernel.org>

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 3/3] Input: tsc2007 - drop redundant error message on IRQ request failure
  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
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-11-14  0:44 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andy Shevchenko, Svyatoslav Ryhel, H . Nikolaus Schaller,
	Andreas Kemnade, Johannes Kirchmair, Yuki Horii, linux-input,
	linux-kernel

On Sat, Nov 14, 2026 at 2:02 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> devm_request_threaded_irq() already logs an error message when
> requesting the interrupt fails, so the additional dev_err() call in
> tsc2007_input_configure() is redundant. Remove it.

Reviewed-by: Andy Shevchenko <andy@kernel.org>

-- 
With Best Regards,
Andy Shevchenko

^ 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®