Input-zforce_ts: Adjustments for two function implementations
Subsystems (3)
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
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
@@ -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
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 +0100Omit 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
PATCH 2/2 Input: zforce_ts: Delete an unnecessary return statement in zforce_input_close()
In reply to SF Markus ElfringFrom: 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
@@ -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
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 +0100The 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