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] [day] [month] [year] [list]
Message-Id: <20181106135121.dd015f188709c4ccb2bff52c@linux-foundation.org>
Date:   Tue, 6 Nov 2018 13:51:21 -0800
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     William Kucharski <william.kucharski@...cle.com>
Cc:     miles.chen@...iatek.com, Michal Hocko <mhocko@...e.com>,
        Joe Perches <joe@...ches.com>,
        Matthew Wilcox <willy@...radead.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, wsd_upstream@...iatek.com,
        Michal Hocko <mhocko@...nel.org>
Subject: Re: [PATCH v4] mm/page_owner: clamp read count to PAGE_SIZE

On Thu, 1 Nov 2018 18:41:33 -0600 William Kucharski <william.kucharski@...cle.com> wrote:

> 
> 
> > On Nov 1, 2018, at 3:47 PM, Andrew Morton <akpm@...ux-foundation.org> wrote:
> > 
> > -	count = count > PAGE_SIZE ? PAGE_SIZE : count;
> > +	count = min_t(size_t, count, PAGE_SIZE);
> > 	kbuf = kmalloc(count, GFP_KERNEL);
> > 	if (!kbuf)
> > 		return -ENOMEM;
> 
> Is the use of min_t vs. the C conditional mostly to be more self-documenting?

Yup.  It saves the reader from having to parse the code to figure out
"this is a min operation".

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ