From: SF Markus Elfring <hidden> Date: 2018-01-11 17:58:39
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:48:28 +0100
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (5):
Combine four seq_printf() calls into two in ocm_debugfs_show()
Use seq_putc() in ocm_debugfs_show()
Delete an error message for a failed memory allocation in three functions
Improve a size determination in two functions
Delete an unnecessary return statement in two functions
arch/powerpc/platforms/4xx/msi.c | 7 +++----
arch/powerpc/platforms/4xx/ocm.c | 19 +++++--------------
arch/powerpc/platforms/4xx/pci.c | 1 -
3 files changed, 8 insertions(+), 19 deletions(-)
--
2.15.1
From: SF Markus Elfring <hidden> Date: 2018-01-11 18:00:45
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:08:08 +0100
Some data were printed into a sequence by four separate function calls.
Print the same data by two single function calls instead.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>
---
arch/powerpc/platforms/4xx/ocm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
From: SF Markus Elfring <hidden> Date: 2018-01-11 18:01:46
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:10:02 +0100
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 <redacted>
---
arch/powerpc/platforms/4xx/ocm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: SF Markus Elfring <hidden> Date: 2018-01-11 18:02:57
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:28:54 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>
---
arch/powerpc/platforms/4xx/msi.c | 5 ++---
arch/powerpc/platforms/4xx/ocm.c | 5 +----
2 files changed, 3 insertions(+), 7 deletions(-)
@@ -337,7 +337,6 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,ocm_blk=kzalloc(sizeof(structocm_block),GFP_KERNEL);if(!ocm_blk){-printk(KERN_ERR"PPC4XX OCM: could not allocate ocm block");rh_free(ocm_reg->rh,offset);break;}
@@ -391,10 +390,8 @@ static int __init ppc4xx_ocm_init(void)return0;ocm_nodes=kzalloc((count*sizeof(structocm_info)),GFP_KERNEL);-if(!ocm_nodes){-printk(KERN_ERR"PPC4XX OCM: failed to allocate OCM nodes!\n");+if(!ocm_nodes)return-ENOMEM;-}ocm_count=count;count=0;
From: SF Markus Elfring <hidden> Date: 2018-01-11 18:05:09
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:40:23 +0100
The script "checkpatch.pl" pointed information out like the following.
WARNING: void function return statements are not generally useful
Thus remove such a statement in the affected functions.
Signed-off-by: Markus Elfring <redacted>
---
arch/powerpc/platforms/4xx/ocm.c | 2 --
arch/powerpc/platforms/4xx/pci.c | 1 -
2 files changed, 3 deletions(-)
From: SF Markus Elfring <hidden> Date: 2018-01-11 18:09:09
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:32:33 +0100
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 <redacted>
---
arch/powerpc/platforms/4xx/msi.c | 2 +-
arch/powerpc/platforms/4xx/ocm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
From: Michael Ellerman <hidden> Date: 2018-12-23 13:28:15
On Thu, 2018-01-11 at 18:01:33 UTC, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:10:02 +0100
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 <redacted>
From: Michael Ellerman <hidden> Date: 2018-12-23 13:28:18
On Thu, 2018-01-11 at 18:02:45 UTC, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:28:54 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>
From: Michael Ellerman <hidden> Date: 2018-12-23 13:28:20
On Thu, 2018-01-11 at 18:04:54 UTC, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:40:23 +0100
The script "checkpatch.pl" pointed information out like the following.
WARNING: void function return statements are not generally useful
Thus remove such a statement in the affected functions.
Signed-off-by: Markus Elfring <redacted>
From: Michael Ellerman <hidden> Date: 2018-12-23 13:28:33
On Thu, 2018-01-11 at 18:00:33 UTC, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Thu, 11 Jan 2018 18:08:08 +0100
Some data were printed into a sequence by four separate function calls.
Print the same data by two single function calls instead.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>