* [PATCH] drivers: memory: This patch fix the following checkpatch warning.
@ 2019-04-16 8:46 Mohan Kumar
2019-04-16 8:49 ` Roger Quadros
0 siblings, 1 reply; 3+ messages in thread
From: Mohan Kumar @ 2019-04-16 8:46 UTC (permalink / raw)
To: rogerq; +Cc: tony, linux-omap, linux-kernel
Switch hardcoded function name with a reference to __func__ making the
code more maintainable
WARNING: Prefer using '"%s...", __func__' to using function's name, in a
string
Use pr_warn instead of printk
WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>
---
drivers/memory/omap-gpmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index f629759..685f422 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -795,7 +795,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
#endif
gpmc_cs_bool_timings(cs, &t->bool_timings);
- gpmc_cs_show_timings(cs, "after gpmc_cs_set_timings");
+ gpmc_cs_show_timings(cs, "%s", __func__);
return 0;
}
@@ -1033,7 +1033,7 @@ void gpmc_cs_free(int cs)
spin_lock(&gpmc_mem_lock);
if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) {
- printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
+ pr_err("Trying to free non-reserved GPMC CS%d\n", cs);
BUG();
spin_unlock(&gpmc_mem_lock);
return;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: memory: This patch fix the following checkpatch warning.
2019-04-16 8:46 [PATCH] drivers: memory: This patch fix the following checkpatch warning Mohan Kumar
@ 2019-04-16 8:49 ` Roger Quadros
0 siblings, 0 replies; 3+ messages in thread
From: Roger Quadros @ 2019-04-16 8:49 UTC (permalink / raw)
To: Mohan Kumar; +Cc: tony, linux-omap, linux-kernel
Hi Mohan,
On 16/04/2019 11:46, Mohan Kumar wrote:
> Switch hardcoded function name with a reference to __func__ making the
> code more maintainable
>
> WARNING: Prefer using '"%s...", __func__' to using function's name, in a
> string
>
> Use pr_warn instead of printk
>
> WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
> then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
>
> Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>
> ---
> drivers/memory/omap-gpmc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index f629759..685f422 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -795,7 +795,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
> #endif
>
> gpmc_cs_bool_timings(cs, &t->bool_timings);
> - gpmc_cs_show_timings(cs, "after gpmc_cs_set_timings");
> + gpmc_cs_show_timings(cs, "%s", __func__);
This will not build. gpmc_cs_show_timings only takes 2 arguments.
>
> return 0;
> }
> @@ -1033,7 +1033,7 @@ void gpmc_cs_free(int cs)
>
> spin_lock(&gpmc_mem_lock);
> if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) {
> - printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
> + pr_err("Trying to free non-reserved GPMC CS%d\n", cs);
> BUG();
> spin_unlock(&gpmc_mem_lock);
> return;
>
cheers,
-roger
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: memory: This patch fix the following checkpatch warning.
@ 2019-04-16 8:49 ` Roger Quadros
0 siblings, 0 replies; 3+ messages in thread
From: Roger Quadros @ 2019-04-16 8:49 UTC (permalink / raw)
To: Mohan Kumar; +Cc: tony, linux-omap, linux-kernel
Hi Mohan,
On 16/04/2019 11:46, Mohan Kumar wrote:
> Switch hardcoded function name with a reference to __func__ making the
> code more maintainable
>
> WARNING: Prefer using '"%s...", __func__' to using function's name, in a
> string
>
> Use pr_warn instead of printk
>
> WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
> then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
>
> Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>
> ---
> drivers/memory/omap-gpmc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index f629759..685f422 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -795,7 +795,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
> #endif
>
> gpmc_cs_bool_timings(cs, &t->bool_timings);
> - gpmc_cs_show_timings(cs, "after gpmc_cs_set_timings");
> + gpmc_cs_show_timings(cs, "%s", __func__);
This will not build. gpmc_cs_show_timings only takes 2 arguments.
>
> return 0;
> }
> @@ -1033,7 +1033,7 @@ void gpmc_cs_free(int cs)
>
> spin_lock(&gpmc_mem_lock);
> if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) {
> - printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
> + pr_err("Trying to free non-reserved GPMC CS%d\n", cs);
> BUG();
> spin_unlock(&gpmc_mem_lock);
> return;
>
cheers,
-roger
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-16 8:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 8:46 [PATCH] drivers: memory: This patch fix the following checkpatch warning Mohan Kumar
2019-04-16 8:49 ` Roger Quadros
2019-04-16 8:49 ` Roger Quadros
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.