2018-01-20 20:16:48

by SF Markus Elfring

[permalink] [raw]
Subject: [PATCH 0/2] Input-zforce_ts: Adjustments for two function implementations

From: Markus Elfring <[email protected]>
Date: Sat, 20 Jan 2018 21:07:42 +0100

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
Delete an error message for a failed memory allocation in zforce_parse_dt()
Delete an unnecessary return statement in zforce_input_close()

drivers/input/touchscreen/zforce_ts.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

--
2.15.1



2018-01-20 20:19:44

by SF Markus Elfring

[permalink] [raw]
Subject: [PATCH 1/2] Input: zforce_ts: Delete an error message for a failed memory allocation in zforce_parse_dt()

From: Markus Elfring <[email protected]>
Date: Sat, 20 Jan 2018 20:36:33 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
---
drivers/input/touchscreen/zforce_ts.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 7b3845aa5983..9fb6b3f201f9 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -722,10 +722,8 @@ static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)
return ERR_PTR(-ENOENT);

pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata) {
- dev_err(dev, "failed to allocate platform data\n");
+ if (!pdata)
return ERR_PTR(-ENOMEM);
- }

if (of_property_read_u32(np, "x-size", &pdata->x_max)) {
dev_err(dev, "failed to get x-size property\n");
--
2.15.1


2018-01-20 20:21:58

by SF Markus Elfring

[permalink] [raw]
Subject: [PATCH 2/2] Input: zforce_ts: Delete an unnecessary return statement in zforce_input_close()

From: Markus Elfring <[email protected]>
Date: Sat, 20 Jan 2018 20:43:06 +0100

The script "checkpatch.pl" pointed information out like the following.

WARNING: void function return statements are not generally useful

Thus remove such a statement in the affected function.

Signed-off-by: Markus Elfring <[email protected]>
---
drivers/input/touchscreen/zforce_ts.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 9fb6b3f201f9..e462a152b4e6 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -612,8 +612,6 @@ static void zforce_input_close(struct input_dev *dev)
ret = zforce_stop(ts);
if (ret)
dev_warn(&client->dev, "stopping zforce failed\n");
-
- return;
}

static int __maybe_unused zforce_suspend(struct device *dev)
--
2.15.1


2018-01-20 20:29:58

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 2/2] Input: zforce_ts: Delete an unnecessary return statement in zforce_input_close()

Am Samstag, 20. Januar 2018, 21:20:38 CET schrieb SF Markus Elfring:
> From: Markus Elfring <[email protected]>
> Date: Sat, 20 Jan 2018 20:43:06 +0100
>
> The script "checkpatch.pl" pointed information out like the following.
>
> WARNING: void function return statements are not generally useful
>
> Thus remove such a statement in the affected function.
>
> Signed-off-by: Markus Elfring <[email protected]>

if it helps
Reviewed-by: Heiko Stuebner <[email protected]>

2018-01-20 20:30:18

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 1/2] Input: zforce_ts: Delete an error message for a failed memory allocation in zforce_parse_dt()

Am Samstag, 20. Januar 2018, 21:18:45 CET schrieb SF Markus Elfring:
> From: Markus Elfring <[email protected]>
> Date: Sat, 20 Jan 2018 20:36:33 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <[email protected]>

if it helps
Reviewed-by: Heiko Stuebner <[email protected]>