All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Input: omap4-keypad: Adjustments for omap4_keypad_probe()
@ 2018-01-26 13:48 ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-26 13:48 UTC (permalink / raw)
  To: linux-input, Christophe Jaillet, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 26 Jan 2018 14:45:54 +0100

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

Markus Elfring (2):
  Delete two error messages for a failed memory allocation
  Improve a size determination

 drivers/input/keyboard/omap4-keypad.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.16.1

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

* [PATCH 0/2] Input: omap4-keypad: Adjustments for omap4_keypad_probe()
@ 2018-01-26 13:48 ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-26 13:48 UTC (permalink / raw)
  To: linux-input, Christophe Jaillet, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 26 Jan 2018 14:45:54 +0100

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

Markus Elfring (2):
  Delete two error messages for a failed memory allocation
  Improve a size determination

 drivers/input/keyboard/omap4-keypad.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.16.1


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

* [PATCH 1/2] Input: omap4-keypad: Delete two error messages for a failed memory allocation in omap4_keypad_probe()
  2018-01-26 13:48 ` SF Markus Elfring
@ 2018-01-26 13:49   ` SF Markus Elfring
  -1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-26 13:49 UTC (permalink / raw)
  To: linux-input, Christophe Jaillet, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 26 Jan 2018 14:24:35 +0100

Omit extra messages 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/keyboard/omap4-keypad.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 940d38b08e6b..6fe554e4026e 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -257,10 +257,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	}
 
 	keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
-	if (!keypad_data) {
-		dev_err(&pdev->dev, "keypad_data memory allocation failed\n");
+	if (!keypad_data)
 		return -ENOMEM;
-	}
 
 	keypad_data->irq = irq;
 
@@ -340,7 +338,6 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	keypad_data->keymap = kzalloc(max_keys * sizeof(keypad_data->keymap[0]),
 				      GFP_KERNEL);
 	if (!keypad_data->keymap) {
-		dev_err(&pdev->dev, "Not enough memory for keymap\n");
 		error = -ENOMEM;
 		goto err_free_input;
 	}
-- 
2.16.1

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

* [PATCH 1/2] Input: omap4-keypad: Delete two error messages for a failed memory allocation in omap4_k
@ 2018-01-26 13:49   ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-26 13:49 UTC (permalink / raw)
  To: linux-input, Christophe Jaillet, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 26 Jan 2018 14:24:35 +0100

Omit extra messages 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/keyboard/omap4-keypad.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 940d38b08e6b..6fe554e4026e 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -257,10 +257,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	}
 
 	keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
-	if (!keypad_data) {
-		dev_err(&pdev->dev, "keypad_data memory allocation failed\n");
+	if (!keypad_data)
 		return -ENOMEM;
-	}
 
 	keypad_data->irq = irq;
 
@@ -340,7 +338,6 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	keypad_data->keymap = kzalloc(max_keys * sizeof(keypad_data->keymap[0]),
 				      GFP_KERNEL);
 	if (!keypad_data->keymap) {
-		dev_err(&pdev->dev, "Not enough memory for keymap\n");
 		error = -ENOMEM;
 		goto err_free_input;
 	}
-- 
2.16.1


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

* [PATCH 2/2] Input: omap4-keypad: Improve a size determination in omap4_keypad_probe()
  2018-01-26 13:48 ` SF Markus Elfring
@ 2018-01-26 13:50   ` SF Markus Elfring
  -1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-26 13:50 UTC (permalink / raw)
  To: linux-input, Christophe Jaillet, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 26 Jan 2018 14:28:07 +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/keyboard/omap4-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 6fe554e4026e..4b5bd0c611d6 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -256,7 +256,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
+	keypad_data = kzalloc(sizeof(*keypad_data), GFP_KERNEL);
 	if (!keypad_data)
 		return -ENOMEM;
 
-- 
2.16.1

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

* [PATCH 2/2] Input: omap4-keypad: Improve a size determination in omap4_keypad_probe()
@ 2018-01-26 13:50   ` SF Markus Elfring
  0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-26 13:50 UTC (permalink / raw)
  To: linux-input, Christophe Jaillet, Dmitry Torokhov; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 26 Jan 2018 14:28:07 +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/keyboard/omap4-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 6fe554e4026e..4b5bd0c611d6 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -256,7 +256,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
+	keypad_data = kzalloc(sizeof(*keypad_data), GFP_KERNEL);
 	if (!keypad_data)
 		return -ENOMEM;
 
-- 
2.16.1


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

end of thread, other threads:[~2018-01-26 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 13:48 [PATCH 0/2] Input: omap4-keypad: Adjustments for omap4_keypad_probe() SF Markus Elfring
2018-01-26 13:48 ` SF Markus Elfring
2018-01-26 13:49 ` [PATCH 1/2] Input: omap4-keypad: Delete two error messages for a failed memory allocation in omap4_keypad_probe() SF Markus Elfring
2018-01-26 13:49   ` [PATCH 1/2] Input: omap4-keypad: Delete two error messages for a failed memory allocation in omap4_k SF Markus Elfring
2018-01-26 13:50 ` [PATCH 2/2] Input: omap4-keypad: Improve a size determination in omap4_keypad_probe() SF Markus Elfring
2018-01-26 13:50   ` SF Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.