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]
Date:	Mon, 08 Aug 2011 09:11:52 -0700
From:	Joe Perches <joe@...ches.com>
To:	David Howells <dhowells@...hat.com>
Cc:	torvalds@...l.org, linux-kernel@...r.kernel.org,
	autofs@...ux.kernel.org, Ian Kent <raven@...maw.net>
Subject: Re: [PATCH] autofs4: Use no_printk() for no-op DPRINTK() and use
 __VA_ARGS__ too

On Mon, 2011-08-08 at 16:10 +0100, David Howells wrote:
> Use no_printk() for autofs's no-op DPRINTK() to prevent unused statements from
> becoming accidentally obsolete, and use __VA_ARGS__ too as that's the standard
> way.
[]
> diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
> index 475f9c5..c3a419f 100644
> --- a/fs/autofs4/autofs_i.h
> +++ b/fs/autofs4/autofs_i.h
> @@ -40,13 +40,17 @@
>  /* #define DEBUG */
>  
>  #ifdef DEBUG
> -#define DPRINTK(fmt, args...)				\
> +#define DPRINTK(fmt, ...)				\
>  do {							\
>  	printk(KERN_DEBUG "pid %d: %s: " fmt "\n",	\
> -		current->pid, __func__, ##args);	\
> +		current->pid, __func__, ##__VA_ARGS__);	\
>  } while (0)
>  #else
> -#define DPRINTK(fmt, args...) do {} while (0)
> +#define DPRINTK(fmt, ...)					\
> +do {								\
> +	no_printk(KERN_DEBUG "pid %d: %s: " fmt "\n",		\
> +		  current->pid, __func__, ##__VA_ARGS__);	\
> +} while (0)

single statement macros don't need do {} while (0),
and this could be

#define DPRINTK(fmt, args...)					\
	pr_debug("pid %d: %s: " fmt "\n",			\
		 current->pid, __func__, ##__VA_ARGS__)

When using dynamic debug __func__ and pid are unnecessary as
these can be added to any pr_debug output with '+f' and '+t'
so I think those should not be added either.

I think the DPRINTK macro should be removed altogether and
pr_debug should be used instead.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ