On Fri, Oct 20, 2017 at 10:59:45PM +0900, Masahiro Yamada wrote:
> 2017-10-20 22:54 GMT+09:00 Greg KH <[email protected]>:
> > On Fri, Oct 20, 2017 at 10:47:28PM +0900, Masahiro Yamada wrote:
> >> 2017-10-20 22:34 GMT+09:00 Greg KH <[email protected]>:
> >> > On Mon, Oct 09, 2017 at 03:26:31PM +0200, [email protected] 
> >> > wrote:
> >> >> From: Masahiro Yamada <[email protected]>
> >> >>
> >> >> nvmem_register() copies all the members of nvmem_config to
> >> >> nvmem_device.  So, nvmem_config is one-time use data during
> >> >> probing.  There is no point to keep it until the driver detach.
> >> >> Using stack should be no problem because nvmem_config is pretty
> >> >> small.
> >> >
> >> > Same objection as previous patch, what is wrong with it as-is?
> >> >
> >>
> >> It is wasting memory.
> >
> > The memory is freed again, after the call, right?
> >
> 
> I assume your "as-is" meant devm_kzalloc().
> 
> The memory is freed when the driver is detached.
> 
> It is generally quite long time
> that this struct occupies the memory for no good reason.

Ah, ok, a simple kmalloc() might be better, but ok, if you are _sure_
it's ok taking that much stack space up... :)

thanks,

greg k-h

Reply via email to