On Sat, 2016-09-17 at 12:09 -0500, Larry Finger wrote:
> As soon as debugging is turned on, the logs are filled with messages
> reporting the interrupt status. As this quantity is usually zero, this
> output is not needed. In fact, there will be a report if the status is
> not zero, thus the debug line in question could probably be deleted.
> Rather than taking that action, I have changed it to only be printed
> when the RTL8XXXU_DEBUG_USB bit is set in the debug mask.

There are many uses of
        if (rtl8xxxu_debug & <DEFINE>) {
                dev_info(dev, ...)

Emitting debugging information at KERN_INFO is odd.

I think it'd be nicer to use dev_dbg for all these cases
and as well use some new macro that includes the test

Something like:

#define rtl8xxxu_dbg(type, fmt, ...)                    \
do {                                                    \
        if (rtl8xxxu_debug & (type))                    \
                dev_dbg(dev, fmt, ##__VA_ARGS__);       \
} while (0)

> Signed-off-by: Larry Finger <larry.fin...@lwfinger.net>
> ---
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 
> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 9f6dbb4..236f33c 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -5260,7 +5260,8 @@ static void rtl8xxxu_int_complete(struct urb *urb)
>       struct device *dev = &priv->udev->dev;
>       int ret;
>  
> -     dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
> +     if (rtl8xxxu_debug & RTL8XXXU_DEBUG_USB)
> +             dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
>       if (urb->status == 0) {
>               usb_anchor_urb(urb, &priv->int_anchor);
>               ret = usb_submit_urb(urb, GFP_ATOMIC);
> 
> 
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to