diff mbox series

[3/4] nvmem: remove inline in drivers/nvmem/core.c

Message ID 20170911090014.16806-4-srinivas.kandagatla@linaro.org
State New
Headers show
Series nvmem: set2 patches for v4.14 | expand

Commit Message

Srinivas Kandagatla Sept. 11, 2017, 9 a.m. UTC
From: Masahiro Yamada <yamada.masahiro@socionext.com>


These two functions are defined in .c file, but called just once
(at least for now).  So, the compiler will fold them into their
callers even without the "inline" markers.

However, this kind of optimization should not be done by hand.
It is compiler's judge after all.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 drivers/nvmem/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.9.3

Comments

Greg Kroah-Hartman Sept. 18, 2017, 2:09 p.m. UTC | #1
On Mon, Sep 11, 2017 at 11:00:13AM +0200, srinivas.kandagatla@linaro.org wrote:
> From: Masahiro Yamada <yamada.masahiro@socionext.com>

> 

> These two functions are defined in .c file, but called just once

> (at least for now).  So, the compiler will fold them into their

> callers even without the "inline" markers.

> 

> However, this kind of optimization should not be done by hand.

> It is compiler's judge after all.

> 

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---

>  drivers/nvmem/core.c | 7 +++----

>  1 file changed, 3 insertions(+), 4 deletions(-)


This isn't really a bugfix, so should wait for 4.15-rc1.

thanks,

greg k-h
Srinivas Kandagatla Sept. 18, 2017, 3:02 p.m. UTC | #2
On 18/09/17 15:09, Greg Kroah-Hartman wrote:
> On Mon, Sep 11, 2017 at 11:00:13AM +0200, srinivas.kandagatla@linaro.org wrote:

>> From: Masahiro Yamada <yamada.masahiro@socionext.com>

>>

>> These two functions are defined in .c file, but called just once

>> (at least for now).  So, the compiler will fold them into their

>> callers even without the "inline" markers.

>>

>> However, this kind of optimization should not be done by hand.

>> It is compiler's judge after all.

>>

>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

>> ---

>>   drivers/nvmem/core.c | 7 +++----

>>   1 file changed, 3 insertions(+), 4 deletions(-)

> 

> This isn't really a bugfix, so should wait for 4.15-rc1.


No rush for this patch, we can take it in 4.15-rc1..

thanks,
srini
> 

> thanks,

> 

> greg k-h

>
diff mbox series

Patch

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index d12e5de..fdb8b7a 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -946,8 +946,7 @@  void nvmem_cell_put(struct nvmem_cell *cell)
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_put);
 
-static inline void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell,
-						    void *buf)
+static void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, void *buf)
 {
 	u8 *p, *b;
 	int i, bit_offset = cell->bit_offset;
@@ -1028,8 +1027,8 @@  void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_read);
 
-static inline void *nvmem_cell_prepare_write_buffer(struct nvmem_cell *cell,
-						    u8 *_buf, int len)
+static void *nvmem_cell_prepare_write_buffer(struct nvmem_cell *cell,
+					     u8 *_buf, int len)
 {
 	struct nvmem_device *nvmem = cell->nvmem;
 	int i, rc, nbits, bit_offset = cell->bit_offset;