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: <030bb11d193d13a2d1c161a133bb7b88093a1fe9.camel@perches.com>
Date:   Sat, 13 Jun 2020 09:14:02 -0700
From:   Joe Perches <joe@...ches.com>
To:     Jim Cromie <jim.cromie@...il.com>, jbaron@...mai.com,
        linux-kernel@...r.kernel.org, akpm@...uxfoundation.org,
        gregkh@...uxfoundation.org
Cc:     linux@...musvillemoes.dk
Subject: Re: [PATCH v2 09/24] dyndbg: add maybe(str,"") macro to reduce code

On Sat, 2020-06-13 at 09:57 -0600, Jim Cromie wrote:
> reduce word count via macro, no actual object change.
> 
> OTOH, maybe() could be scrubbed if printk's default printing (iirc) of
> "(null)" pointers is deemed appropriate for the log-msg.
[]
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
[]
> @@ -114,6 +114,7 @@ do {								\
>  #define vpr_info(fmt, ...)	vnpr_info(1, fmt, ##__VA_ARGS__)
>  #define v2pr_info(fmt, ...)	vnpr_info(2, fmt, ##__VA_ARGS__)
>  
> +#define maybe(str, empty)	( str ? str : empty )

This macro is unnecessary.

An even shorter very commonly used gcc extension would be

	str ?: empty


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ