From d27a30bbc8b0c84a4cc922b201f9e85e9a2de741 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 1 Jun 2017 21:48:11 +0200 Subject: [PATCH 1/5] ARM: OMAP1: DMA: Improve a size determination in omap1_system_dma_init() 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 Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index c821c1d5610e..823dba3dc033 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -339,7 +339,7 @@ static int __init omap1_system_dma_init(void) goto exit_iounmap; } - d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL); + d = kzalloc(sizeof(*d), GFP_KERNEL); if (!d) { dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n", __func__, pdev->name); From 61ee221ee45bc10d9115ba6ce8862ee62289a98f Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 1 Jun 2017 21:54:36 +0200 Subject: [PATCH 2/5] ARM: OMAP1: DMA: Delete an error message for a failed memory allocation in omap1_system_dma_init() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/dma.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index 823dba3dc033..c545b4e01d53 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -341,8 +341,6 @@ static int __init omap1_system_dma_init(void) d = kzalloc(sizeof(*d), GFP_KERNEL); if (!d) { - dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n", - __func__, pdev->name); ret = -ENOMEM; goto exit_iounmap; } From 2abe5b343dc790cc577700b07ca8d10fed62ae0e Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 1 Jun 2017 22:00:21 +0200 Subject: [PATCH 3/5] ARM: OMAP1: DMA: Delete an unnecessary return statement in omap1_show_dma_caps() 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 function. Signed-off-by: Markus Elfring Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/dma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index c545b4e01d53..52d7eda1adec 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -240,7 +240,6 @@ static void omap1_show_dma_caps(void) w |= 1 << 3; dma_write(w, GSCR, 0); } - return; } static unsigned configure_dma_errata(void) From a9e317c388d48da80fc266f06dc6298cbd790b8c Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 1 Jun 2017 22:04:29 +0200 Subject: [PATCH 4/5] ARM: OMAP1: Delete an error message for a failed memory allocation in omap1_dm_timer_init() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/timer.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c index 06c5ba7574a5..637f8c9d9f10 100644 --- a/arch/arm/mach-omap1/timer.c +++ b/arch/arm/mach-omap1/timer.c @@ -134,8 +134,6 @@ static int __init omap1_dm_timer_init(void) pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); if (!pdata) { - dev_err(&pdev->dev, "%s: Failed to allocate pdata.\n", - __func__); ret = -ENOMEM; goto err_free_pdata; } From 764e4ef0a8871339eeddaf27ccc47aeeea28b974 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 1 Jun 2017 22:17:03 +0200 Subject: [PATCH 5/5] ARM: OMAP1: Fix a typo in a comment line Adjust a line in this description for the software module. Signed-off-by: Markus Elfring Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c index 637f8c9d9f10..8fb1ec6fa999 100644 --- a/arch/arm/mach-omap1/timer.c +++ b/arch/arm/mach-omap1/timer.c @@ -3,7 +3,7 @@ * * Contains first level initialization routines which internally * generates timer device information and registers with linux - * device model. It also has low level function to chnage the timer + * device model. It also has a low level function to change the timer * input clock source. * * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/