* [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations
@ 2017-10-03 20:12 SF Markus Elfring
2017-10-03 20:13 ` [PATCH 1/4] ARM: OMAP: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-03 20:12 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Oct 2017 22:04:22 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (4):
Delete an error message for a failed memory allocation in two functions
Improve a size determination in two functions
Use kcalloc() in omap_system_dma_probe()
Fix typos in two comment lines in _omap_dm_timer_request()
arch/arm/plat-omap/dma.c | 12 +++++-------
arch/arm/plat-omap/dmtimer.c | 10 ++++------
2 files changed, 9 insertions(+), 13 deletions(-)
--
2.14.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] ARM: OMAP: Delete an error message for a failed memory allocation in two functions
2017-10-03 20:12 [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations SF Markus Elfring
@ 2017-10-03 20:13 ` SF Markus Elfring
2017-10-03 20:14 ` [PATCH 2/4] ARM: OMAP: Improve a size determination " SF Markus Elfring
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-03 20:13 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Oct 2017 13:10:26 +0200
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/arm/plat-omap/dma.c | 5 +----
arch/arm/plat-omap/dmtimer.c | 4 +---
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 1e460b4ee3b9..6ede0427548c 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1317,11 +1317,8 @@ static int omap_system_dma_probe(struct platform_device *pdev)
dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count,
sizeof(struct omap_dma_lch), GFP_KERNEL);
- if (!dma_chan) {
- dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__);
+ if (!dma_chan)
return -ENOMEM;
- }
-
if (dma_omap2plus()) {
dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7a327bd32521..446ac0e3a35a 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -858,10 +858,8 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
}
timer = devm_kzalloc(dev, sizeof(struct omap_dm_timer), GFP_KERNEL);
- if (!timer) {
- dev_err(dev, "%s: memory alloc failed!\n", __func__);
+ if (!timer)
return -ENOMEM;
- }
timer->fclk = ERR_PTR(-ENODEV);
timer->io_base = devm_ioremap_resource(dev, mem);
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] ARM: OMAP: Improve a size determination in two functions
2017-10-03 20:12 [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations SF Markus Elfring
2017-10-03 20:13 ` [PATCH 1/4] ARM: OMAP: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
@ 2017-10-03 20:14 ` SF Markus Elfring
2017-10-03 20:15 ` [PATCH 3/4] ARM: OMAP: Use kcalloc() in omap_system_dma_probe() SF Markus Elfring
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-03 20:14 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Oct 2017 20:46:48 +0200
Replace the specification of data structures by pointer dereferences
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>
---
arch/arm/plat-omap/dma.c | 2 +-
arch/arm/plat-omap/dmtimer.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 6ede0427548c..409e4ecaebe9 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1316,7 +1316,7 @@ static int omap_system_dma_probe(struct platform_device *pdev)
enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count,
- sizeof(struct omap_dma_lch), GFP_KERNEL);
+ sizeof(*dma_chan), GFP_KERNEL);
if (!dma_chan)
return -ENOMEM;
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 446ac0e3a35a..14779d6f425d 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -857,7 +857,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
return -ENODEV;
}
- timer = devm_kzalloc(dev, sizeof(struct omap_dm_timer), GFP_KERNEL);
+ timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL);
if (!timer)
return -ENOMEM;
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ARM: OMAP: Use kcalloc() in omap_system_dma_probe()
2017-10-03 20:12 [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations SF Markus Elfring
2017-10-03 20:13 ` [PATCH 1/4] ARM: OMAP: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-10-03 20:14 ` [PATCH 2/4] ARM: OMAP: Improve a size determination " SF Markus Elfring
@ 2017-10-03 20:15 ` SF Markus Elfring
2017-10-03 20:16 ` [PATCH 4/4] ARM: OMAP: Fix typos in two comment lines in _omap_dm_timer_request() SF Markus Elfring
2017-10-11 18:20 ` [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations Tony Lindgren
4 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-03 20:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Oct 2017 21:07:33 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/arm/plat-omap/dma.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 409e4ecaebe9..d4012d6c0dcb 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1321,8 +1321,9 @@ static int omap_system_dma_probe(struct platform_device *pdev)
return -ENOMEM;
if (dma_omap2plus()) {
- dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
- dma_lch_count, GFP_KERNEL);
+ dma_linked_lch = kcalloc(dma_lch_count,
+ sizeof(*dma_linked_lch),
+ GFP_KERNEL);
if (!dma_linked_lch) {
ret = -ENOMEM;
goto exit_dma_lch_fail;
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ARM: OMAP: Fix typos in two comment lines in _omap_dm_timer_request()
2017-10-03 20:12 [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations SF Markus Elfring
` (2 preceding siblings ...)
2017-10-03 20:15 ` [PATCH 3/4] ARM: OMAP: Use kcalloc() in omap_system_dma_probe() SF Markus Elfring
@ 2017-10-03 20:16 ` SF Markus Elfring
2017-10-11 18:20 ` [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations Tony Lindgren
4 siblings, 0 replies; 6+ messages in thread
From: SF Markus Elfring @ 2017-10-03 20:16 UTC (permalink / raw)
To: linux-arm-kernel
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Oct 2017 21:24:00 +0200
Adjust three words in this description.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/arm/plat-omap/dmtimer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 14779d6f425d..d443e481c3e9 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -254,8 +254,8 @@ static struct omap_dm_timer *_omap_dm_timer_request(int req_type, void *data)
if (cap == (t->capability & cap)) {
/*
* If timer is not NULL, we have already found
- * one timer but it was not an exact match
- * because it had more capabilites that what
+ * one timer. But it was not an exact match
+ * because it had more capabilities than what
* was required. Therefore, unreserve the last
* timer found and see if this one is a better
* match.
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations
2017-10-03 20:12 [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations SF Markus Elfring
` (3 preceding siblings ...)
2017-10-03 20:16 ` [PATCH 4/4] ARM: OMAP: Fix typos in two comment lines in _omap_dm_timer_request() SF Markus Elfring
@ 2017-10-11 18:20 ` Tony Lindgren
4 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2017-10-11 18:20 UTC (permalink / raw)
To: linux-arm-kernel
* SF Markus Elfring <elfring@users.sourceforge.net> [171003 13:13]:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 3 Oct 2017 22:04:22 +0200
>
> A few update suggestions were taken into account
> from static source code analysis.
Applying all into omap-for-v4.15/soc thanks.
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-10-11 18:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 20:12 [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations SF Markus Elfring
2017-10-03 20:13 ` [PATCH 1/4] ARM: OMAP: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-10-03 20:14 ` [PATCH 2/4] ARM: OMAP: Improve a size determination " SF Markus Elfring
2017-10-03 20:15 ` [PATCH 3/4] ARM: OMAP: Use kcalloc() in omap_system_dma_probe() SF Markus Elfring
2017-10-03 20:16 ` [PATCH 4/4] ARM: OMAP: Fix typos in two comment lines in _omap_dm_timer_request() SF Markus Elfring
2017-10-11 18:20 ` [PATCH 0/4] ARM-OMAP: Adjustments for three function implementations Tony Lindgren
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).