Re: [PATCH 52/69] staging: unisys: remove DBGINF() macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 05, 2014 at 05:09:27PM -0500, Benjamin Romer wrote:
> Remove the DBGINF() group of logging macros and use pr_debug() instead. Fix
> places that used the DBGINF() macro so they actually print the expected value,
> because they were not being compiled at all before the switchover.
> 
> Signed-off-by: Ken Depro <kenneth.depro@xxxxxxxxxx>
> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
> ---
>  drivers/staging/unisys/include/timskmod.h  |  2 --
>  drivers/staging/unisys/include/uniklog.h   | 39 --------------------
>  drivers/staging/unisys/uislib/uislib.c     |  8 ++---
>  drivers/staging/unisys/uislib/uisutils.c   |  2 +-
>  drivers/staging/unisys/virthba/virthba.c   | 57 +++++++++++++++---------------
>  drivers/staging/unisys/virtpci/virtpci.c   | 41 ++++++++++-----------
>  drivers/staging/unisys/visorchipset/file.c | 18 +++++-----
>  7 files changed, 64 insertions(+), 103 deletions(-)
> 
> diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
> index 7831dbc..3d563c4 100644
> --- a/drivers/staging/unisys/include/timskmod.h
> +++ b/drivers/staging/unisys/include/timskmod.h
> @@ -91,14 +91,12 @@
>  #define WARNDRV(fmt, args...)   LOGWRN(fmt, ## args)
>  #define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args)
>  #define INFODRV(fmt, args...)   LOGINF(fmt, ## args)
> -#define DEBUGDRV(fmt, args...)  DBGINF(fmt, ## args)
>  
>  #define PRINTKDEV(devname, fmt, args...)  LOGINFDEV(devname, fmt, ## args)
>  #define WARNDEV(devname, fmt, args...)    LOGWRNDEV(devname, fmt, ## args)
>  #define SECUREDEV(devname, fmt, args...)  LOGWRNDEV(devname, fmt, ## args)
>  #define INFODEV(devname, fmt, args...)    LOGINFDEV(devname, fmt, ## args)
>  #define INFODEVX(devno, fmt, args...)     LOGINFDEVX(devno, fmt, ## args)
> -#define DEBUGDEV(devname, fmt, args...)   DBGINFDEV(devname, fmt, ## args)
>  
>  /** Verifies the consistency of your PRIVATEDEVICEDATA structure using
>   *  conventional "signature" fields:
> diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h
> index e94120b..edc12f0 100644
> --- a/drivers/staging/unisys/include/uniklog.h
> +++ b/drivers/staging/unisys/include/uniklog.h
> @@ -26,45 +26,6 @@
>  #include <linux/printk.h>
>  
>  /*
> - * # DBGINF
> - *
> - * \brief Log debug informational message - log a LOG_INFO message only
> - *        if DEBUG compiletime option enabled
> - *
> - * \param devname the device name of the device reporting this message, or
> - *                NULL if this message is NOT device-related.
> - * \param fmt printf()-style format string containing the message to log.
> - * \param args Optional arguments to be formatted and inserted into the
> - *             format string.
> - * \return nothing
> - *
> - * Log a message at the LOG_INFO level, but only if DEBUG is enabled.  If
> - * DEBUG is disabled, this expands to a no-op.
> - */
> -
> -/*
> - * # DBGVER
> - *
> - * \brief Log debug verbose message - log a LOG_DEBUG message only if
> - *        DEBUG compiletime option enabled
> - *
> - * \param devname the device name of the device reporting this message, or
> - *                NULL if this message is NOT device-related.
> - * \param fmt printf()-style format string containing the message to log.
> - * \param args Optional arguments to be formatted and inserted into the
> - *             format string.
> - * \return nothing
> - *
> - * Log a message at the LOG_DEBUG level, but only if DEBUG is enabled.  If
> - * DEBUG is disabled, this expands to a no-op.  Note also that LOG_DEBUG
> - * messages can be enabled/disabled at runtime as well.
> - */
> -#define DBGINFDEV(devname, fmt, args...)        do { } while (0)
> -#define DBGVERDEV(devname, fmt, args...)        do { } while (0)
> -#define DBGINF(fmt, args...)                    do { } while (0)
> -#define DBGVER(fmt, args...)                    do { } while (0)
> -
> -/*
>   * # LOGINF
>   *
>   * \brief Log informational message - logs a message at the LOG_INFO level
> diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
> index eb58449..d986fde 100644
> --- a/drivers/staging/unisys/uislib/uislib.c
> +++ b/drivers/staging/unisys/uislib/uislib.c
> @@ -1161,7 +1161,7 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf,
>  
>  /* *start = buf; */
>  	if (debug_buf == NULL) {
> -		DBGINF("debug_buf == NULL; allocating buffer.\n.");
> +		pr_debug("debug_buf == NULL; allocating buffer.\n.");
>  		debug_buf = vmalloc(PROC_READ_BUFFER_SIZE);
>  
>  		if (debug_buf == NULL) {
> @@ -1173,7 +1173,7 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf,
>  	temp = debug_buf;
>  
>  	if ((*offset == 0) || (!debug_buf_valid)) {
> -		DBGINF("calling info_debugfs_read_helper.\n");
> +		pr_debug("calling info_debugfs_read_helper.\n");
>  		/* if the read fails, then -1 will be returned */
>  		total_bytes = info_debugfs_read_helper(&temp, &remaining_bytes);
>  		debug_buf_valid = 1;
> @@ -1333,7 +1333,7 @@ static int process_incoming(void *v)
>  			idle_cycles = idle_cycles + delta_cycles;
>  		}
>  	}
> -	DBGINF("exiting.\n");
> +	pr_debug("exiting.\n");

"trace" messages like this should just be deleted everywhere as the
kernel has built-in tracing functionality, use it instead.

thanks,

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



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux