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

2018-07-13 Thread Greg KH
On Fri, Jul 13, 2018 at 12:58:47AM +0200, Felix Siegel wrote:
> > Function calls that do nothing but log "Look at this function I just
> > entered/exited!" need to just be deleted entirely, as ftrace should be
> > used instead.
> > 
> > Care to do that here, and then send a patch for the remaining messages
> > that do need __func__?
> Sure. I hope this is how you meant it.
> I kept the calls that print more than just the name of the function.

Looks great, thanks, I'll go queue them up.

You can also now work on converting those macros to the "normal" kernel
logging macros if you want (dev_*()) as no single driver/subsystem
should have their own set of logging macros.

thanks,

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


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

2018-07-12 Thread Felix Siegel
> Function calls that do nothing but log "Look at this function I just
> entered/exited!" need to just be deleted entirely, as ftrace should be
> used instead.
> 
> Care to do that here, and then send a patch for the remaining messages
> that do need __func__?
Sure. I hope this is how you meant it.
I kept the calls that print more than just the name of the function.

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


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

2018-07-12 Thread Greg Kroah-Hartman
On Thu, Jul 12, 2018 at 09:27:15PM +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   | 15 ---
>  drivers/staging/gasket/gasket_core.c   | 11 ++-
>  drivers/staging/gasket/gasket_ioctl.c  |  4 ++--
>  drivers/staging/gasket/gasket_page_table.c | 13 -
>  4 files changed, 24 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/gasket/apex_driver.c 
> b/drivers/staging/gasket/apex_driver.c
> index ffcc59d..735d43d 100644
> --- a/drivers/staging/gasket/apex_driver.c
> +++ b/drivers/staging/gasket/apex_driver.c
> @@ -341,7 +341,7 @@ static int apex_add_dev_cb(struct gasket_dev *gasket_dev)
>   ulong page_table_ready, msix_table_ready;
>   int retries = 0;
>  
> - gasket_log_error(gasket_dev, "apex_add_dev_cb.");
> + gasket_log_error(gasket_dev, "%s.", __func__);

Function calls that do nothing but log "Look at this function I just
entered/exited!" need to just be deleted entirely, as ftrace should be
used instead.

Care to do that here, and then send a patch for the remaining messages
that do need __func__?

thanks,

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


[PATCH 4/4] 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   | 15 ---
 drivers/staging/gasket/gasket_core.c   | 11 ++-
 drivers/staging/gasket/gasket_ioctl.c  |  4 ++--
 drivers/staging/gasket/gasket_page_table.c | 13 -
 4 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/gasket/apex_driver.c 
b/drivers/staging/gasket/apex_driver.c
index ffcc59d..735d43d 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -341,7 +341,7 @@ static int apex_add_dev_cb(struct gasket_dev *gasket_dev)
ulong page_table_ready, msix_table_ready;
int retries = 0;
 
-   gasket_log_error(gasket_dev, "apex_add_dev_cb.");
+   gasket_log_error(gasket_dev, "%s.", __func__);
 
apex_reset(gasket_dev, 0);
 
@@ -422,8 +422,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)
@@ -447,13 +448,13 @@ static int apex_reset(struct gasket_dev *gasket_dev, uint 
type)
if (bypass_top_level)
return 0;
 
-   gasket_log_debug(gasket_dev, "apex_reset.");
+   gasket_log_debug(gasket_dev, "%s.", __func__);
 
if (!is_gcb_in_reset(gasket_dev)) {
/* 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)
@@ -472,7 +473,7 @@ static int apex_enter_reset(struct gasket_dev *gasket_dev, 
uint type)
if (bypass_top_level)
return 0;
 
-   gasket_log_debug(gasket_dev, "apex_enter_reset.");
+   gasket_log_debug(gasket_dev, "%s.", __func__);
 
/*
 * Software reset:
@@ -534,7 +535,7 @@ static int apex_quit_reset(struct gasket_dev *gasket_dev, 
uint type)
if (bypass_top_level)
return 0;
 
-   gasket_log_debug(gasket_dev, "apex_quit_reset.");
+   gasket_log_debug(gasket_dev, "%s.", __func__);
 
/*
 * Disable sleep mode:
@@ -681,7 +682,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 5eeaae7..b14a956 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -932,7 +932,8 @@ 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;
}
@@ -2100,9 +2101,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",
-   offset, count, diff_nanosec);
+   __func__, offset, count, diff_nanosec);
return -1;
}
reg = gasket_dev_read_64(gasket_dev, bar, offset);
@@ -2141,8 +2142,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)",
-   offset, max_retries * delay_ms);
+   "%s timeout: reg %llx timeout (%llu ms)",
+   __func__, offset, max_retries * delay_ms);
return -EINVAL;
}
return 0;
diff --git a/drivers/staging/gasket/gasket_ioctl.c 
b/drivers/staging/gasket/gasket_ioctl.c
index 832beed..738c56f 100644
--- a/drivers/staging/gasket/gasket_ioctl.c
+++ b/