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: <20080110232812.GH17430@duck.suse.cz>
Date:	Fri, 11 Jan 2008 00:28:12 +0100
From:	Jan Kara <jack@...e.cz>
To:	marcin.slusarz@...il.com
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 15/16] udf: fix udf_debug macro

On Thu 10-01-08 23:06:31, marcin.slusarz@...il.com wrote:
> udf_debug should be enclosed with do { } while (0)
> to be safely used in code like below:
> if (something)
> 	udf_debug();
> else
> 	anything;
> (Otherwise compiler will not compile it with:
> "error: expected expression before 'else'")
> 
> Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
> CC: Jan Kara <jack@...e.cz>
> ---
>  include/linux/udf_fs.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
> index 36c684e..c954527 100644
> --- a/include/linux/udf_fs.h
> +++ b/include/linux/udf_fs.h
> @@ -39,11 +39,11 @@
>  
>  #ifdef UDFFS_DEBUG
>  #define udf_debug(f, a...) \
> -	{ \
> +	do { \
>  		printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
>  			__FILE__, __LINE__, __FUNCTION__); \
>  		printk (f, ##a); \
> -	}
> +	} while (0)
>  #else
>  #define udf_debug(f, a...) /**/
>  #endif
  Actually, in that case you should also change /**/ to
  do {} while (0)

								Honza
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
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