From: sean.wang@mediatek.com (Sean Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it
Date: Fri, 22 Sep 2017 11:59:47 +0800 [thread overview]
Message-ID: <1506052787.21515.10.camel@mtkswgap22> (raw)
In-Reply-To: <CAK7LNARoZnVduzkWqyTYq4iMEAi0A88cpGWrD0Zc=wt=Xa+1QA@mail.gmail.com>
Hi, Masahiro
On Thu, 2017-09-21 at 11:09 +0900, Masahiro Yamada wrote:
> Hi Sean,
>
>
> 2017-09-21 1:32 GMT+09:00 Sean Wang <sean.wang@mediatek.com>:
> > Hi, Masahiro
> >
> > For maintainability, I felt it's better if we use the same way to
> > register nvmem as that most drivers does under nvmem usually using
> > static structure. Otherwise, they should also be changed to use the
> > one-time data in stack to avoid extra bytes to keep them.
> >
> > Sean
>
>
> Srinivas and I discussed the best practice for allocating nvmem_config.
> https://lkml.org/lkml/2017/9/11/4
>
> From the discussion, static structure is possible only when
> the system has one instance of the device.
>
thank you for your detailed explanation
> If you know this is the case for mediatek,
> yes, you can turn it into static,
> but it is not always possible.
> For example, Socionext SoCs have
> two banks of efuse devices.
>
there should be only one instance of nvmem for mediatek soc, currently
> So, if we want to align the coding style for consistency,
> nvmem in stack is safe and efficient, I think.
>
>
> Moving one-time data into stack slightly
> reduces the kernel image size.
>
>
agreed on those statements, indeed bigger struct uart_8250_port is still
used on stack for configuring in a lot 8250 driver, so
Acked-by: Sean Wang <sean.wang@mediatek.com>
next prev parent reply other threads:[~2017-09-22 3:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 13:00 [PATCH 0/5] nvmem: some cleanups and sparse warning fixes Masahiro Yamada
2017-09-11 13:01 ` [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it Masahiro Yamada
2017-09-20 16:32 ` Sean Wang
2017-09-21 2:09 ` Masahiro Yamada
2017-09-22 3:59 ` Sean Wang [this message]
2017-09-11 13:01 ` [PATCH 3/5] nvmem: mtk-efuse: fix different address space warnings of sparse Masahiro Yamada
2017-09-20 16:19 ` Sean Wang
2017-09-11 13:01 ` [PATCH 5/5] nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset Masahiro Yamada
2017-09-20 10:02 ` [PATCH 0/5] nvmem: some cleanups and sparse warning fixes Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506052787.21515.10.camel@mtkswgap22 \
--to=sean.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox