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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1701200202001.88633@chino.kir.corp.google.com>
Date:   Fri, 20 Jan 2017 02:02:47 -0800 (PST)
From:   David Rientjes <rientjes@...gle.com>
To:     Vlastimil Babka <vbabka@...e.cz>
cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...nel.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Mel Gorman <mgorman@...e.de>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [patch] mm, oom: header nodemask is NULL when cpusets are
 disabled

On Fri, 20 Jan 2017, Vlastimil Babka wrote:

> Could we simplify both patches with something like this?
> Although the sizeof("null") is not the nicest thing, because it relies on knowledge
> that pointer() in lib/vsprintf.c uses this string. Maybe Rasmus has some better idea?
> 
> Thanks,
> Vlastimil
> 
> diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
> index f746e44d4046..4add88ef63f0 100644
> --- a/include/linux/nodemask.h
> +++ b/include/linux/nodemask.h
> @@ -103,7 +103,7 @@ extern nodemask_t _unused_nodemask_arg_;
>   *
>   * Can be used to provide arguments for '%*pb[l]' when printing a nodemask.
>   */
> -#define nodemask_pr_args(maskp)		MAX_NUMNODES, (maskp)->bits
> +#define nodemask_pr_args(maskp)		((maskp) ? MAX_NUMNODES : (int) sizeof("null")), ((maskp) ? (maskp)->bits : NULL)
>  
>  /*
>   * The inline keyword gives the compiler room to decide to inline, or
> 

That's creative.  I'm not sure if it's worth it considering 
nodemask_pr_args() is usually used in a context where we know we have a 
nodemask :)  These would be the only two exceptions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ