Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance()
Subsystems (2)
Dmitry Torokhov
maintainerPATCH 1/3 Input: tsc2007 - drop unnecessary cast in tsc2007_calculate_resistance()
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.
--- drivers/input/touchscreen/tsc2007_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/tsc2007_core.c +1 -1
@@ -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)
Signature · 1 line
2.56.0.679.gc527c65306-goog
Dmitry Torokhov
maintainerPATCH 2/3 Input: tsc2007 - use scnprintf() when formatting phys string
Use scnprintf() instead of snprintf() when constructing the physical device path string to follow kernel string formatting conventions.
--- drivers/input/touchscreen/tsc2007_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/tsc2007_core.c +1 -1
@@ -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;
Signature · 1 line
2.56.0.679.gc527c65306-goog
Re: [PATCH 2/3] Input: tsc2007 - use scnprintf() when formatting phys string
Quoted 3 lines · Dmitry Torokhov
Use
scnprintf()instead ofsnprintf()when constructing the physical device path string to follow kernel string formatting conventions.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Dmitry Torokhov
maintainerPATCH 3/3 Input: tsc2007 - drop redundant error message on IRQ request failure
In reply to Dmitry Torokhovdevm_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.
--- drivers/input/touchscreen/tsc2007_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/input/touchscreen/tsc2007_core.c +1 -3
@@ -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) {
Signature · 1 line
2.56.0.679.gc527c65306-goog
Re: [PATCH 3/3] Input: tsc2007 - drop redundant error message on IRQ request failure
Quoted 4 lines · Dmitry Torokhov
devm_request_threaded_irq()already logs an error message when requesting the interrupt fails, so the additionaldev_err()call intsc2007_input_configure()is redundant. Remove it.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 4 lines · Dmitry Torokhov
The resistance value is already bounds-checked against
U32_MAXbefore returning from a function returning u32, so the explicit cast is unnecessary. Drop it.
Signature · 2 lines
With Best Regards, Andy Shevchenko