* [PATCH 0/2] Input: nspire-keypad: Adjustments for nspire_keypad_probe()
@ 2018-01-27 9:52 ` SF Markus Elfring
0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-27 9:52 UTC (permalink / raw)
To: linux-input, Daniel Tang, Dmitry Torokhov; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 10:48:28 +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/keyboard/nspire-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: nspire-keypad: Adjustments for nspire_keypad_probe()
@ 2018-01-27 9:52 ` SF Markus Elfring
0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-27 9:52 UTC (permalink / raw)
To: linux-input, Daniel Tang, Dmitry Torokhov; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 10:48:28 +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/keyboard/nspire-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: nspire-keypad: Delete an error message for a failed memory allocation in nspire_keypad_probe()
2018-01-27 9:52 ` SF Markus Elfring
@ 2018-01-27 9:54 ` SF Markus Elfring
-1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-27 9:54 UTC (permalink / raw)
To: linux-input, Daniel Tang, Dmitry Torokhov; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 10:33:37 +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/keyboard/nspire-keypad.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index c7f26fa3034c..f13b50213f94 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -175,10 +175,8 @@ static int nspire_keypad_probe(struct platform_device *pdev)
keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad),
GFP_KERNEL);
- if (!keypad) {
- dev_err(&pdev->dev, "failed to allocate keypad memory\n");
+ if (!keypad)
return -ENOMEM;
- }
keypad->row_shift = get_count_order(KEYPAD_BITMASK_COLS);
--
2.16.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] Input: nspire-keypad: Delete an error message for a failed memory allocation in nspire_k
@ 2018-01-27 9:54 ` SF Markus Elfring
0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-27 9:54 UTC (permalink / raw)
To: linux-input, Daniel Tang, Dmitry Torokhov; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 10:33:37 +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/keyboard/nspire-keypad.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index c7f26fa3034c..f13b50213f94 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -175,10 +175,8 @@ static int nspire_keypad_probe(struct platform_device *pdev)
keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad),
GFP_KERNEL);
- if (!keypad) {
- dev_err(&pdev->dev, "failed to allocate keypad memory\n");
+ if (!keypad)
return -ENOMEM;
- }
keypad->row_shift = get_count_order(KEYPAD_BITMASK_COLS);
--
2.16.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] Input: nspire-keypad: Improve a size determination in nspire_keypad_probe()
2018-01-27 9:52 ` SF Markus Elfring
@ 2018-01-27 9:55 ` SF Markus Elfring
-1 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-27 9:55 UTC (permalink / raw)
To: linux-input, Daniel Tang, Dmitry Torokhov; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 10:36:20 +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/nspire-keypad.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index f13b50213f94..caadc99741c0 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -173,8 +173,7 @@ static int nspire_keypad_probe(struct platform_device *pdev)
return -EINVAL;
}
- keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad),
- GFP_KERNEL);
+ keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
if (!keypad)
return -ENOMEM;
--
2.16.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] Input: nspire-keypad: Improve a size determination in nspire_keypad_probe()
@ 2018-01-27 9:55 ` SF Markus Elfring
0 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2018-01-27 9:55 UTC (permalink / raw)
To: linux-input, Daniel Tang, Dmitry Torokhov; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 27 Jan 2018 10:36:20 +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/nspire-keypad.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index f13b50213f94..caadc99741c0 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -173,8 +173,7 @@ static int nspire_keypad_probe(struct platform_device *pdev)
return -EINVAL;
}
- keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad),
- GFP_KERNEL);
+ keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
if (!keypad)
return -ENOMEM;
--
2.16.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-01-27 9:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-27 9:52 [PATCH 0/2] Input: nspire-keypad: Adjustments for nspire_keypad_probe() SF Markus Elfring
2018-01-27 9:52 ` SF Markus Elfring
2018-01-27 9:54 ` [PATCH 1/2] Input: nspire-keypad: Delete an error message for a failed memory allocation in nspire_keypad_probe() SF Markus Elfring
2018-01-27 9:54 ` [PATCH 1/2] Input: nspire-keypad: Delete an error message for a failed memory allocation in nspire_k SF Markus Elfring
2018-01-27 9:55 ` [PATCH 2/2] Input: nspire-keypad: Improve a size determination in nspire_keypad_probe() SF Markus Elfring
2018-01-27 9:55 ` 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.