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:   Fri, 21 Aug 2020 11:18:39 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Michal Simek <michal.simek@...inx.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Guenter Roeck <linux@...ck-us.net>, linux-iio@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH v8 1/3] devres: provide devm_krealloc()

On Fri, Aug 21, 2020 at 11:15:55AM +0300, Andy Shevchenko wrote:
> On Thu, Aug 20, 2020 at 08:51:08PM +0200, Bartosz Golaszewski wrote:

...

> > +static struct devres *to_devres(void *data)
> > +{
> > +	return data - ALIGN(sizeof(struct devres), ARCH_KMALLOC_MINALIGN);
> > +}
> > +
> > +static size_t devres_data_size(size_t total_size)
> > +{
> > +	return total_size - ALIGN(sizeof(struct devres), ARCH_KMALLOC_MINALIGN);
> > +}
> 
> I'm fine with above, but here is a side note, perhaps
> 
> 	offsetof(struct devres,	data)
> 
> will be more practical (no duplication of alignment and hence slightly better
> maintenance)? (Note, I didn't check if it provides the correct result)

And if the result is correct wouldn't be first a simple container_of() after
all?

> Another side note: do we have existing users of these helpers?

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ