linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] SoC-TI-knav_dma: Fine-tuning for three function implementations
@ 2017-05-01 19:26 SF Markus Elfring
  2017-05-01 19:27 ` [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels() SF Markus Elfring
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-05-01 19:26 UTC (permalink / raw)
  To: linux-arm-kernel, Santosh Shilimkar; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 21:21:42 +0200

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

Markus Elfring (3):
  Use seq_putc() in dma_debug_show_channels()
  Improve a size determination in knav_dma_probe()
  Delete error messages for a failed memory allocation in two functions

 drivers/soc/ti/knav_dma.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

-- 
2.12.2

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

* [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels()
  2017-05-01 19:26 [PATCH 0/3] SoC-TI-knav_dma: Fine-tuning for three function implementations SF Markus Elfring
@ 2017-05-01 19:27 ` SF Markus Elfring
  2018-01-19 16:59   ` Santosh Shilimkar
  2017-05-01 19:28 ` [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe() SF Markus Elfring
  2017-05-01 19:30 ` [PATCH 3/3] soc-knav_dma: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
  2 siblings, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-05-01 19:27 UTC (permalink / raw)
  To: linux-arm-kernel, Santosh Shilimkar; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 20:55:55 +0200

A single character (line break) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

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

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index ecebe2eecc3a..a66671a93199 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -333,7 +333,7 @@ static void dma_debug_show_channels(struct seq_file *s,
 			chan->cfg.u.rx.thresh);
 		for (i = 0; i < KNAV_DMA_FDQ_PER_CHAN; i++)
 			seq_printf(s, "[%d]", chan->cfg.u.rx.fdq[i]);
-		seq_printf(s, "\n");
+		seq_putc(s, '\n');
 	}
 }
 
-- 
2.12.2

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

* [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe()
  2017-05-01 19:26 [PATCH 0/3] SoC-TI-knav_dma: Fine-tuning for three function implementations SF Markus Elfring
  2017-05-01 19:27 ` [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels() SF Markus Elfring
@ 2017-05-01 19:28 ` SF Markus Elfring
  2017-05-01 19:30 ` [PATCH 3/3] soc-knav_dma: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
  2 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-05-01 19:28 UTC (permalink / raw)
  To: linux-arm-kernel, Santosh Shilimkar; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 21:06:46 +0200

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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/soc/ti/knav_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index a66671a93199..410018d9054e 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -739,8 +739,7 @@ static int knav_dma_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	kdev = devm_kzalloc(dev,
-			sizeof(struct knav_dma_pool_device), GFP_KERNEL);
+	kdev = devm_kzalloc(dev, sizeof(*kdev), GFP_KERNEL);
 	if (!kdev) {
 		dev_err(dev, "could not allocate driver mem\n");
 		return -ENOMEM;
-- 
2.12.2

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

* [PATCH 3/3] soc-knav_dma: Delete error messages for a failed memory allocation in two functions
  2017-05-01 19:26 [PATCH 0/3] SoC-TI-knav_dma: Fine-tuning for three function implementations SF Markus Elfring
  2017-05-01 19:27 ` [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels() SF Markus Elfring
  2017-05-01 19:28 ` [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe() SF Markus Elfring
@ 2017-05-01 19:30 ` SF Markus Elfring
  2 siblings, 0 replies; 5+ messages in thread
From: SF Markus Elfring @ 2017-05-01 19:30 UTC (permalink / raw)
  To: linux-arm-kernel, Santosh Shilimkar; +Cc: LKML, kernel-janitors, Wolfram Sang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 21:14:48 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/soc/ti/knav_dma.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index 410018d9054e..dd5adfbf9910 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -621,10 +621,9 @@ static int dma_init(struct device_node *cloud, struct device_node *dma_node)
 	u32 i;
 
 	dma = devm_kzalloc(kdev->dev, sizeof(*dma), GFP_KERNEL);
-	if (!dma) {
-		dev_err(kdev->dev, "could not allocate driver mem\n");
+	if (!dma)
 		return -ENOMEM;
-	}
+
 	INIT_LIST_HEAD(&dma->list);
 	INIT_LIST_HEAD(&dma->chan_list);
 
@@ -740,10 +739,8 @@ static int knav_dma_probe(struct platform_device *pdev)
 	}
 
 	kdev = devm_kzalloc(dev, sizeof(*kdev), GFP_KERNEL);
-	if (!kdev) {
-		dev_err(dev, "could not allocate driver mem\n");
+	if (!kdev)
 		return -ENOMEM;
-	}
 
 	kdev->dev = dev;
 	INIT_LIST_HEAD(&kdev->list);
-- 
2.12.2

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

* Re: [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels()
  2017-05-01 19:27 ` [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels() SF Markus Elfring
@ 2018-01-19 16:59   ` Santosh Shilimkar
  0 siblings, 0 replies; 5+ messages in thread
From: Santosh Shilimkar @ 2018-01-19 16:59 UTC (permalink / raw)
  To: SF Markus Elfring, linux-arm-kernel, Santosh Shilimkar
  Cc: LKML, kernel-janitors

On 5/1/2017 12:27 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 1 May 2017 20:55:55 +0200
> 
> A single character (line break) should be put into a sequence.
> Thus use the corresponding function "seq_putc".
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
Will pick all three patches. Thanks !!

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-01 19:26 [PATCH 0/3] SoC-TI-knav_dma: Fine-tuning for three function implementations SF Markus Elfring
2017-05-01 19:27 ` [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels() SF Markus Elfring
2018-01-19 16:59   ` Santosh Shilimkar
2017-05-01 19:28 ` [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe() SF Markus Elfring
2017-05-01 19:30 ` [PATCH 3/3] soc-knav_dma: Delete error messages for a failed memory allocation in two functions 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).