Skip to contentSkip to conversation

Input-zforce_ts: Adjustments for two function implementations

PATCH In review SF Markus Elfring 2 participants 5 messages Jan 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.15.1
#1 lore raw

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.

---
 drivers/input/touchscreen/zforce_ts.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/input/touchscreen/zforce_ts.c +1 -3
index 7b3845aa5983..9fb6b3f201f9 100644
@@ -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");
Signature · 1 line
2.15.1
Reviewed-by on v1 1/2
#2 lore raw

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:

Quoted 8 lines

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.

if it helps

#3 lore raw

PATCH 2/2 Input: zforce_ts: Delete an unnecessary return statement in zforce_input_close()

In reply to 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.

---
 drivers/input/touchscreen/zforce_ts.c | 2 --
 1 file changed, 2 deletions(-)
drivers/input/touchscreen/zforce_ts.c +0 -2
index 9fb6b3f201f9..e462a152b4e6 100644
@@ -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)
Signature · 1 line
2.15.1
Reviewed-by on v1 2/2
#4 lore raw

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:

Quoted 10 lines

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.

if it helps