lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1256942686.1917.66.camel@Joe-Laptop.home>
Date:	Fri, 30 Oct 2009 15:44:46 -0700
From:	Joe Perches <joe@...ches.com>
To:	Ron Mercer <ron.mercer@...gic.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [net-next PATCH 3/4] qlge: Reduce debug print output.

On Fri, 2009-10-30 at 15:13 -0700, Ron Mercer wrote:
> Signed-off-by: Ron Mercer <ron.mercer@...gic.com>
[]
> diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
> index b9f65e0..502c3af 100644
> --- a/drivers/net/qlge/qlge.h
> +++ b/drivers/net/qlge/qlge.h
> @@ -27,6 +27,18 @@
>  		dev_printk(KERN_##klevel, &((qdev)->pdev->dev),	\
>  			   "%s: " fmt, __func__, ##args);  \
>         } while (0)
> +#if 0
> +#define QPRINTK_DBG(qdev, nlevel, klevel, fmt, args...)	\
> +	do {	\
> +		if (!((qdev)->msg_enable & NETIF_MSG_##nlevel))	\
> +			;					\
> +		else						\
> +			dev_printk(KERN_##klevel, &((qdev)->pdev->dev),	\
> +					"%s: " fmt, __func__, ##args);  \
> +	} while (0)
> +#else
> +#define QPRINTK_DBG(qdev, nlevel, klevel, fmt, args...)
> +#endif

This uses an inverted test and it doesn't verify the args to
dev_printk when not #defined.

How about:

#ifdef DEBUG
#define QPRINTK_DBG(qdev, nlevel, klevel, fmt, args...)	do {	\
	if ((qdev)->msg_enable & NETIF_MSG_##nlevel)		\
		dev_printk(KERN_##klevel, &((qdev)->pdev->dev),	\
			   "%s: " fmt, __func__, ##args);	\
} while (0)
#else
#define QPRINTK_DBG(qdev, nlevel, klevel, fmt, args...)	do {	\
	if (0 && (qdev)->msg_enable & NETIF_MSG_##nlevel)	\
		dev_printk(KERN_##klevel, &((qdev)->pdev->dev),	\
			   "%s: " fmt, __func__, ##args);	\
} while (0)
#endif


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ