* [PATCH 0/2] dmaengine: zx: Fine-tuning for two function implementations
@ 2017-04-22 20:30 SF Markus Elfring
2017-04-22 20:31 ` [PATCH 1/2] dmaengine: zx: Use devm_kcalloc() in zx_dma_probe() SF Markus Elfring
2017-04-22 20:32 ` [PATCH 2/2] dmaengine: zx: Fix a typo in a comment line SF Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-04-22 20:30 UTC (permalink / raw)
To: dmaengine, Dan Williams, Shawn Guo, Vinod Koul; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 22 Apr 2017 22:23:45 +0200
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Use devm_kcalloc() in zx_dma_probe()
Fix a typo in a comment line
drivers/dma/zx_dma.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--
2.12.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] dmaengine: zx: Use devm_kcalloc() in zx_dma_probe()
2017-04-22 20:30 [PATCH 0/2] dmaengine: zx: Fine-tuning for two function implementations SF Markus Elfring
@ 2017-04-22 20:31 ` SF Markus Elfring
2017-04-22 20:32 ` [PATCH 2/2] dmaengine: zx: Fix a typo in a comment line SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-04-22 20:31 UTC (permalink / raw)
To: dmaengine, Dan Williams, Shawn Guo, Vinod Koul; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 22 Apr 2017 22:00:10 +0200
* Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "devm_kcalloc".
This issue was detected by using the Coccinelle software.
* Replace the specification of data structures by pointer dereferences
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>
---
drivers/dma/zx_dma.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 2bb695315300..4f7587a100ea 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -798,8 +798,8 @@ static int zx_dma_probe(struct platform_device *op)
return -ENOMEM;
/* init phy channel */
- d->phy = devm_kzalloc(&op->dev,
- d->dma_channels * sizeof(struct zx_dma_phy), GFP_KERNEL);
+ d->phy = devm_kcalloc(&op->dev, d->dma_channels, sizeof(*d->phy),
+ GFP_KERNEL);
if (!d->phy)
return -ENOMEM;
@@ -834,8 +834,8 @@ static int zx_dma_probe(struct platform_device *op)
d->slave.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
/* init virtual channel */
- d->chans = devm_kzalloc(&op->dev,
- d->dma_requests * sizeof(struct zx_dma_chan), GFP_KERNEL);
+ d->chans = devm_kcalloc(&op->dev, d->dma_requests, sizeof(*d->chans),
+ GFP_KERNEL);
if (!d->chans)
return -ENOMEM;
--
2.12.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] dmaengine: zx: Fix a typo in a comment line
2017-04-22 20:30 [PATCH 0/2] dmaengine: zx: Fine-tuning for two function implementations SF Markus Elfring
2017-04-22 20:31 ` [PATCH 1/2] dmaengine: zx: Use devm_kcalloc() in zx_dma_probe() SF Markus Elfring
@ 2017-04-22 20:32 ` SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-04-22 20:32 UTC (permalink / raw)
To: dmaengine, Dan Williams, Shawn Guo, Vinod Koul; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 22 Apr 2017 22:17:11 +0200
Add a missing character in this description for a function call.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/dma/zx_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 4f7587a100ea..70339cb8fd48 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -886,7 +886,7 @@ static int zx_dma_remove(struct platform_device *op)
struct zx_dma_chan *c, *cn;
struct zx_dma_dev *d = platform_get_drvdata(op);
- /* explictly free the irq */
+ /* explicitly free the irq */
devm_free_irq(&op->dev, d->irq, d);
dma_async_device_unregister(&d->slave);
--
2.12.2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-22 20:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-22 20:30 [PATCH 0/2] dmaengine: zx: Fine-tuning for two function implementations SF Markus Elfring
2017-04-22 20:31 ` [PATCH 1/2] dmaengine: zx: Use devm_kcalloc() in zx_dma_probe() SF Markus Elfring
2017-04-22 20:32 ` [PATCH 2/2] dmaengine: zx: Fix a typo in a comment line 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
Powered by JetHome