Re: [PATCH v2 2/2] staging: gasket: Use __func__ instead of hardcoded string - Style

2018-07-13 Thread Greg KH
On Fri, Jul 13, 2018 at 12:58:49AM +0200, Felix Siegel wrote:
> Changed logging statements to use %s and __func__ instead of hard coding
> the function name in a string.
> 
> Signed-off-by: Felix Siegel 
> ---
>  drivers/staging/gasket/apex_driver.c   |  7 ---
>  drivers/staging/gasket/gasket_core.c   |  8 +---
>  drivers/staging/gasket/gasket_ioctl.c  |  3 ++-
>  drivers/staging/gasket/gasket_page_table.c | 13 -
>  4 files changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/gasket/apex_driver.c 
> b/drivers/staging/gasket/apex_driver.c
> index 9218ad7..ee91137 100644
> --- a/drivers/staging/gasket/apex_driver.c
> +++ b/drivers/staging/gasket/apex_driver.c
> @@ -427,8 +427,9 @@ static int apex_device_cleanup(struct gasket_dev 
> *gasket_dev)
>  
>   gasket_log_info(
>   gasket_dev,
> - "apex_device_cleanup 0x%p hib_error 0x%llx scalar_error "
> + "%s 0x%p hib_error 0x%llx scalar_error "
>   "0x%llx.",

One nit, it's not your doing, but the string should be all on one line
here.  Something to think about for future patches :)

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/2] staging: gasket: Use __func__ instead of hardcoded string - Style

2018-07-12 Thread Felix Siegel
Changed logging statements to use %s and __func__ instead of hard coding
the function name in a string.

Signed-off-by: Felix Siegel 
---
 drivers/staging/gasket/apex_driver.c   |  7 ---
 drivers/staging/gasket/gasket_core.c   |  8 +---
 drivers/staging/gasket/gasket_ioctl.c  |  3 ++-
 drivers/staging/gasket/gasket_page_table.c | 13 -
 4 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/gasket/apex_driver.c 
b/drivers/staging/gasket/apex_driver.c
index 9218ad7..ee91137 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -427,8 +427,9 @@ static int apex_device_cleanup(struct gasket_dev 
*gasket_dev)
 
gasket_log_info(
gasket_dev,
-   "apex_device_cleanup 0x%p hib_error 0x%llx scalar_error "
+   "%s 0x%p hib_error 0x%llx scalar_error "
"0x%llx.",
+   __func__,
gasket_dev, hib_error, scalar_error);
 
if (allow_power_save)
@@ -456,7 +457,7 @@ static int apex_reset(struct gasket_dev *gasket_dev, uint 
type)
/* We are not in reset - toggle the reset bit so as to force
 * re-init of custom block
 */
-   gasket_log_debug(gasket_dev, "apex_reset: toggle reset.");
+   gasket_log_debug(gasket_dev, "%s: toggle reset.", __func__);
 
ret = apex_enter_reset(gasket_dev, type);
if (ret)
@@ -680,7 +681,7 @@ static long apex_clock_gating(struct gasket_dev 
*gasket_dev, ulong arg)
return -EFAULT;
 
gasket_log_error(
-   gasket_dev, "apex_clock_gating %llu", ibuf.enable);
+   gasket_dev, "%s %llu", __func__, ibuf.enable);
 
if (ibuf.enable) {
/* Quiesce AXI, gate GCB clock. */
diff --git a/drivers/staging/gasket/gasket_core.c 
b/drivers/staging/gasket/gasket_core.c
index fa3cd46..f96ca55 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -939,7 +939,7 @@ static int gasket_enable_dev(
} else {
gasket_log_error(
gasket_dev,
-   "gasket_enable_dev with no physical device!!");
+   "%s with no physical device!!", __func__);
WARN_ON(1);
ddev = NULL;
}
@@ -2107,8 +2107,9 @@ int gasket_wait_sync(
if (diff_nanosec > timeout_ns) {
gasket_log_error(
gasket_dev,
-   "gasket_wait_sync timeout: reg %llx count %x "
+   "%s timeout: reg %llx count %x "
"dma %lld ns\n",
+   __func__,
offset, count, diff_nanosec);
return -1;
}
@@ -2148,7 +2149,8 @@ int gasket_wait_with_reschedule(
if (retries == max_retries) {
gasket_log_error(
gasket_dev,
-   "gasket_wait_with_reschedule timeout: reg %llx timeout 
(%llu ms)",
+   "%s timeout: reg %llx timeout (%llu ms)",
+   __func__,
offset, max_retries * delay_ms);
return -EINVAL;
}
diff --git a/drivers/staging/gasket/gasket_ioctl.c 
b/drivers/staging/gasket/gasket_ioctl.c
index 4758083..417f136 100644
--- a/drivers/staging/gasket/gasket_ioctl.c
+++ b/drivers/staging/gasket/gasket_ioctl.c
@@ -187,7 +187,8 @@ static uint gasket_ioctl_check_permissions(struct file 
*filp, uint cmd)
alive = (gasket_dev->status == GASKET_STATUS_ALIVE);
if (!alive) {
gasket_nodev_error(
-   "gasket_ioctl_check_permissions alive %d status %d.",
+   "%s alive %d status %d.",
+   __func__,
alive, gasket_dev->status);
}
 
diff --git a/drivers/staging/gasket/gasket_page_table.c 
b/drivers/staging/gasket/gasket_page_table.c
index 5d3d33c..961db41 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -452,8 +452,9 @@ int gasket_page_table_map(
mutex_unlock(_tbl->mutex);
 
gasket_nodev_debug(
-   "gasket_page_table_map done: ha %llx daddr %llx num %d, "
+   "%s done: ha %llx daddr %llx num %d, "
"ret %d\n",
+   __func__,
(unsigned long long)host_addr,
(unsigned long long)dev_addr, num_pages, ret);
return ret;
@@ -876,7 +877,7 @@ static int gasket_perform_mapping(
for (i = 0; i < num_pages; i++) {
page_addr = host_addr + i * PAGE_SIZE;
offset = page_addr &