linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Input: tps6507x-ts: Adjustments for tps6507x_ts_probe()
@ 2018-01-20 20:58 SF Markus Elfring
  2018-01-20 20:59 ` [PATCH 1/2] Input: tps6507x-ts: Delete an error message for a failed memory allocation in tps6507x_ts_probe() SF Markus Elfring
  2018-01-20 21:00 ` [PATCH 2/2] Input: tps6507x-ts: Improve a size determination " SF Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2018-01-20 20:58 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Yegor Yefremov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 20 Jan 2018 21:53:21 +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
  Improve a size determination

 drivers/input/touchscreen/tps6507x-ts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Input: tps6507x-ts: Delete an error message for a failed memory allocation in tps6507x_ts_probe()
  2018-01-20 20:58 [PATCH 0/2] Input: tps6507x-ts: Adjustments for tps6507x_ts_probe() SF Markus Elfring
@ 2018-01-20 20:59 ` SF Markus Elfring
  2018-01-20 21:00 ` [PATCH 2/2] Input: tps6507x-ts: Improve a size determination " SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2018-01-20 20:59 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Yegor Yefremov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 20 Jan 2018 21:43:54 +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 <elfring@users.sourceforge.net>
---
 drivers/input/touchscreen/tps6507x-ts.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 75170a7439b1..5b2756ec1766 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -227,10 +227,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
 	init_data = tps_board->tps6507x_ts_init_data;
 
 	tsc = devm_kzalloc(&pdev->dev, sizeof(struct tps6507x_ts), GFP_KERNEL);
-	if (!tsc) {
-		dev_err(tps6507x_dev->dev, "failed to allocate driver data\n");
+	if (!tsc)
 		return -ENOMEM;
-	}
 
 	tsc->mfd = tps6507x_dev;
 	tsc->dev = tps6507x_dev->dev;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Input: tps6507x-ts: Improve a size determination in tps6507x_ts_probe()
  2018-01-20 20:58 [PATCH 0/2] Input: tps6507x-ts: Adjustments for tps6507x_ts_probe() SF Markus Elfring
  2018-01-20 20:59 ` [PATCH 1/2] Input: tps6507x-ts: Delete an error message for a failed memory allocation in tps6507x_ts_probe() SF Markus Elfring
@ 2018-01-20 21:00 ` SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2018-01-20 21:00 UTC (permalink / raw)
  To: linux-input, Dmitry Torokhov, Yegor Yefremov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 20 Jan 2018 21:47:16 +0100

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/input/touchscreen/tps6507x-ts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 5b2756ec1766..83b24e202d8e 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -226,7 +226,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
 	 */
 	init_data = tps_board->tps6507x_ts_init_data;
 
-	tsc = devm_kzalloc(&pdev->dev, sizeof(struct tps6507x_ts), GFP_KERNEL);
+	tsc = devm_kzalloc(&pdev->dev, sizeof(*tsc), GFP_KERNEL);
 	if (!tsc)
 		return -ENOMEM;
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-20 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-20 20:58 [PATCH 0/2] Input: tps6507x-ts: Adjustments for tps6507x_ts_probe() SF Markus Elfring
2018-01-20 20:59 ` [PATCH 1/2] Input: tps6507x-ts: Delete an error message for a failed memory allocation in tps6507x_ts_probe() SF Markus Elfring
2018-01-20 21:00 ` [PATCH 2/2] Input: tps6507x-ts: Improve a size determination " SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).