Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736330

Re: [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it

From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it
Date 2017-09-21 04:20 +0200
Message-ID <urZfP-34T-1@gated-at.bofh.it> (permalink)
References <uowDn-3I9-5@gated-at.bofh.it> <uowDn-3I9-3@gated-at.bofh.it> <urQcx-5vV-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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.

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.


-- 
Best Regards
Masahiro Yamada

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-11 15:10 +0200
  Re: [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config  instead of malloc'ing it Sean Wang <sean.wang@mediatek.com> - 2017-09-20 18:40 +0200
    Re: [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead  of malloc'ing it Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-09-21 04:20 +0200
      Re: [PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config  instead of malloc'ing it Sean Wang <sean.wang@mediatek.com> - 2017-09-22 06:10 +0200

csiph-web