2021-01-14 15:25:38

by Lee Jones

[permalink] [raw]
Subject: [PATCH v3 0/5] (Set 2/2) Rid W=1 issues from Input

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

This is the second (and last) of 2 sets.

v3:
- Make use of 'ret' instead of removing it
- Use __always_unused instead of removing unused variables
- Fix recent/new warning regarding undocumented 'prop' param

v2:
- Replace empty if() with commentary
- Suggested-by: Joe Perches


Lee Jones (5):
input: mouse: synaptics: Replace NOOP with suitable commentary
input: touchscreen: melfas_mip4: Mark a bunch of variables as
__always_unused
input: touchscreen: usbtouchscreen: Actually check return value of
usb_submit_urb()
input: touchscreen: surface3_spi: Remove set but unused variable
'timestamp'
input: touchscreen: stmpe-ts: Add description for 'prop' struct member

drivers/input/mouse/synaptics.c | 7 +++++--
drivers/input/touchscreen/melfas_mip4.c | 8 ++++----
drivers/input/touchscreen/stmpe-ts.c | 1 +
drivers/input/touchscreen/surface3_spi.c | 2 --
drivers/input/touchscreen/usbtouchscreen.c | 3 +++
5 files changed, 13 insertions(+), 8 deletions(-)

Cc: Alexandre Torgue <[email protected]>
Cc: Benjamin Tissoires <[email protected]>
Cc: Bruce Kalk <[email protected]>
Cc: "C. Scott Ananian" <[email protected]>
Cc: Daniel Ritz <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Henrik Rydberg <[email protected]>
Cc: James Hilliard <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Luotao Fu <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Peter Osterlund <[email protected]>
Cc: Sangwon Jee <[email protected]>
Cc: Stefan Gmeiner <[email protected]>
Cc: Stefan Riedmueller <[email protected]>
Cc: this to <[email protected]>
--
2.25.1


2021-01-14 15:25:41

by Lee Jones

[permalink] [raw]
Subject: [PATCH 2/5] input: touchscreen: melfas_mip4: Mark a bunch of variables as __always_unused

Dmitry requested to keep these around for the purposes of documentation.

Fixes the following W=1 kernel build warning(s):

drivers/input/touchscreen/melfas_mip4.c: In function ‘mip4_report_touch’:
drivers/input/touchscreen/melfas_mip4.c:474:5: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
drivers/input/touchscreen/melfas_mip4.c:472:5: warning: variable ‘pressure_stage’ set but not used [-Wunused-but-set-variable]
drivers/input/touchscreen/melfas_mip4.c:469:7: warning: variable ‘palm’ set but not used [-Wunused-but-set-variable]
drivers/input/touchscreen/melfas_mip4.c:468:7: warning: variable ‘hover’ set but not used [-Wunused-but-set-variable]

Cc: Sangwon Jee <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Henrik Rydberg <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/input/touchscreen/melfas_mip4.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index c0050044a5a9e..225796a3f5460 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -465,13 +465,13 @@ static void mip4_report_keys(struct mip4_ts *ts, u8 *packet)
static void mip4_report_touch(struct mip4_ts *ts, u8 *packet)
{
int id;
- bool hover;
- bool palm;
+ bool __always_unused hover;
+ bool __always_unused palm;
bool state;
u16 x, y;
- u8 pressure_stage = 0;
+ u8 __always_unused pressure_stage = 0;
u8 pressure;
- u8 size;
+ u8 __always_unused size;
u8 touch_major;
u8 touch_minor;

--
2.25.1

2021-01-14 15:25:56

by Lee Jones

[permalink] [raw]
Subject: [PATCH 1/5] input: mouse: synaptics: Replace NOOP with suitable commentary

Fixes the following W=1 kernel build warning(s):

drivers/input/mouse/synaptics.c: In function ‘synaptics_process_packet’:
drivers/input/mouse/synaptics.c:1110:6: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Cc: Dmitry Torokhov <[email protected]>
Cc: Henrik Rydberg <[email protected]>
Cc: Peter Osterlund <[email protected]>
Cc: Stefan Gmeiner <[email protected]>
Cc: "C. Scott Ananian" <[email protected]>
Cc: Bruce Kalk <[email protected]>
Cc: this to <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/input/mouse/synaptics.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 8fb7b4385ded9..3cc8b76629fa2 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1106,8 +1106,11 @@ static void synaptics_process_packet(struct psmouse *psmouse)
num_fingers = hw.w + 2;
break;
case 2:
- if (SYN_MODEL_PEN(info->model_id))
- ; /* Nothing, treat a pen as a single finger */
+ /*
+ * Keep defaults
+ *
+ * SYN_MODEL_PEN: Treat pens as a single finger
+ */
break;
case 4 ... 15:
if (SYN_CAP_PALMDETECT(info->capabilities))
--
2.25.1

2021-01-14 15:27:43

by Lee Jones

[permalink] [raw]
Subject: [PATCH 3/5] input: touchscreen: usbtouchscreen: Actually check return value of usb_submit_urb()

Fixes the following W=1 kernel build warning(s):

drivers/input/touchscreen/usbtouchscreen.c: In function ‘nexio_read_data’:
drivers/input/touchscreen/usbtouchscreen.c:1052:50: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Dmitry Torokhov <[email protected]>
Cc: Henrik Rydberg <[email protected]>
Cc: James Hilliard <[email protected]>
Cc: Daniel Ritz <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/input/touchscreen/usbtouchscreen.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 397cb1d3f481b..44a5454d04533 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1044,6 +1044,7 @@ static void nexio_exit(struct usbtouch_usb *usbtouch)

static int nexio_read_data(struct usbtouch_usb *usbtouch, unsigned char *pkt)
{
+ struct device *dev = &usbtouch->interface->dev;
struct nexio_touch_packet *packet = (void *) pkt;
struct nexio_priv *priv = usbtouch->priv;
unsigned int data_len = be16_to_cpu(packet->data_len);
@@ -1062,6 +1063,8 @@ static int nexio_read_data(struct usbtouch_usb *usbtouch, unsigned char *pkt)

/* send ACK */
ret = usb_submit_urb(priv->ack, GFP_ATOMIC);
+ if (ret)
+ dev_warn(dev, "Failed to submit USB Request Block\n");

if (!usbtouch->type->max_xc) {
usbtouch->type->max_xc = 2 * x_len;
--
2.25.1

2021-01-14 15:28:41

by Lee Jones

[permalink] [raw]
Subject: [PATCH 4/5] input: touchscreen: surface3_spi: Remove set but unused variable 'timestamp'

Fixes the following W=1 kernel build warning(s):

drivers/input/touchscreen/surface3_spi.c: In function ‘surface3_spi_process_touch’:
drivers/input/touchscreen/surface3_spi.c:97:6: warning: variable ‘timestamp’ set but not used [-Wunused-but-set-variable]

Cc: Dmitry Torokhov <[email protected]>
Cc: Henrik Rydberg <[email protected]>
Cc: Benjamin Tissoires <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/input/touchscreen/surface3_spi.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
index 731454599fcee..1da23e5585a0d 100644
--- a/drivers/input/touchscreen/surface3_spi.c
+++ b/drivers/input/touchscreen/surface3_spi.c
@@ -94,9 +94,7 @@ static void surface3_spi_report_touch(struct surface3_ts_data *ts_data,

static void surface3_spi_process_touch(struct surface3_ts_data *ts_data, u8 *data)
{
- u16 timestamp;
unsigned int i;
- timestamp = get_unaligned_le16(&data[15]);

for (i = 0; i < 13; i++) {
struct surface3_ts_data_finger *finger;
--
2.25.1

2021-01-14 15:29:17

by Lee Jones

[permalink] [raw]
Subject: [PATCH 5/5] input: touchscreen: stmpe-ts: Add description for 'prop' struct member

Fixes the following W=1 kernel build warning(s):

drivers/input/touchscreen/stmpe-ts.c:82: warning: Function parameter or member 'prop' not described in 'stmpe_touch'

Cc: Dmitry Torokhov <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Stefan Riedmueller <[email protected]>
Cc: Luotao Fu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/input/touchscreen/stmpe-ts.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index cd747725589b1..25c45c3a35615 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -52,6 +52,7 @@
* @idev: registered input device
* @work: a work item used to scan the device
* @dev: a pointer back to the MFD cell struct device*
+ * @prop: Touchscreen properties
* @ave_ctrl: Sample average control
* (0 -> 1 sample, 1 -> 2 samples, 2 -> 4 samples, 3 -> 8 samples)
* @touch_det_delay: Touch detect interrupt delay
--
2.25.1

2021-01-14 16:07:04

by Benjamin Tissoires

[permalink] [raw]
Subject: Re: [PATCH 4/5] input: touchscreen: surface3_spi: Remove set but unused variable 'timestamp'

On Thu, Jan 14, 2021 at 4:23 PM Lee Jones <[email protected]> wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/input/touchscreen/surface3_spi.c: In function ‘surface3_spi_process_touch’:
> drivers/input/touchscreen/surface3_spi.c:97:6: warning: variable ‘timestamp’ set but not used [-Wunused-but-set-variable]
>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Henrik Rydberg <[email protected]>
> Cc: Benjamin Tissoires <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Reviewed-by: Benjamin Tissoires <[email protected]>

Thanks for the cleanup :)

Cheers,
Benjamin

> ---
> drivers/input/touchscreen/surface3_spi.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
> index 731454599fcee..1da23e5585a0d 100644
> --- a/drivers/input/touchscreen/surface3_spi.c
> +++ b/drivers/input/touchscreen/surface3_spi.c
> @@ -94,9 +94,7 @@ static void surface3_spi_report_touch(struct surface3_ts_data *ts_data,
>
> static void surface3_spi_process_touch(struct surface3_ts_data *ts_data, u8 *data)
> {
> - u16 timestamp;
> unsigned int i;
> - timestamp = get_unaligned_le16(&data[15]);
>
> for (i = 0; i < 13; i++) {
> struct surface3_ts_data_finger *finger;
> --
> 2.25.1
>

2021-01-20 02:22:51

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 2/5] input: touchscreen: melfas_mip4: Mark a bunch of variables as __always_unused

On Thu, Jan 14, 2021 at 03:23:20PM +0000, Lee Jones wrote:
> Dmitry requested to keep these around for the purposes of documentation.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/input/touchscreen/melfas_mip4.c: In function ‘mip4_report_touch’:
> drivers/input/touchscreen/melfas_mip4.c:474:5: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
> drivers/input/touchscreen/melfas_mip4.c:472:5: warning: variable ‘pressure_stage’ set but not used [-Wunused-but-set-variable]
> drivers/input/touchscreen/melfas_mip4.c:469:7: warning: variable ‘palm’ set but not used [-Wunused-but-set-variable]
> drivers/input/touchscreen/melfas_mip4.c:468:7: warning: variable ‘hover’ set but not used [-Wunused-but-set-variable]
>
> Cc: Sangwon Jee <[email protected]>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Henrik Rydberg <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Applied, thank you.

--
Dmitry

2021-01-20 02:23:42

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 3/5] input: touchscreen: usbtouchscreen: Actually check return value of usb_submit_urb()

On Thu, Jan 14, 2021 at 03:23:21PM +0000, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/input/touchscreen/usbtouchscreen.c: In function ‘nexio_read_data’:
> drivers/input/touchscreen/usbtouchscreen.c:1052:50: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Henrik Rydberg <[email protected]>
> Cc: James Hilliard <[email protected]>
> Cc: Daniel Ritz <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Applied, thank you.

--
Dmitry

2021-01-20 02:25:06

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 4/5] input: touchscreen: surface3_spi: Remove set but unused variable 'timestamp'

On Thu, Jan 14, 2021 at 03:23:22PM +0000, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/input/touchscreen/surface3_spi.c: In function ‘surface3_spi_process_touch’:
> drivers/input/touchscreen/surface3_spi.c:97:6: warning: variable ‘timestamp’ set but not used [-Wunused-but-set-variable]
>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Henrik Rydberg <[email protected]>
> Cc: Benjamin Tissoires <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Applied, thank you.

--
Dmitry

2021-01-20 02:25:57

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 5/5] input: touchscreen: stmpe-ts: Add description for 'prop' struct member

On Thu, Jan 14, 2021 at 03:23:23PM +0000, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
>
> drivers/input/touchscreen/stmpe-ts.c:82: warning: Function parameter or member 'prop' not described in 'stmpe_touch'
>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Maxime Coquelin <[email protected]>
> Cc: Alexandre Torgue <[email protected]>
> Cc: Stefan Riedmueller <[email protected]>
> Cc: Luotao Fu <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Applied, thank you.

--
Dmitry