2016-03-30 13:01:06

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH] drivers/mtd/chips/cfi_cmdset_0020.c: Deinline do_write_buffer

This function compiles to 2554 bytes of machine code.
In C, the function is almost 200 lines long.

It has only one callsite, but forced inlining that much code
makes gcc generate worse code. Let gcc itself decide what to do.

text data bss dec hex filename
95943139 20860256 35991552 152794947 91b7743 vmlinux_before
95943075 20860288 35991552 152794915 91b7723 vmlinux

Signed-off-by: Denys Vlasenko <[email protected]>
CC: David Woodhouse <[email protected]>
CC: Brian Norris <[email protected]>
CC: Dan Carpenter <[email protected]>
CC: Artem Bityutskiy <[email protected]>
CC: [email protected]
---
drivers/mtd/chips/cfi_cmdset_0020.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index 9a1a6ff..70dd2b1 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -416,7 +416,7 @@ static int cfi_staa_read (struct mtd_info *mtd, loff_t from, size_t len, size_t
return ret;
}

-static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
+static int do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf, int len)
{
struct cfi_private *cfi = map->fldrv_priv;
--
2.1.0


2016-03-30 13:01:13

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH] drivers/mtd/chips/cfi_cmdset_0020.c: Deinline do_erase_oneblock

This function compiles to 2142 bytes of machine code.
In C, the function is about 150 lines long.

It has only one callsite, but forced inlining that much code
makes gcc generate worse code. Let gcc itself decide what to do.

text data bss dec hex filename
95943075 20860288 35991552 152794915 91b7723 vmlinux_before
95942947 20860288 35991552 152794787 91b76a3 vmlinux

Signed-off-by: Denys Vlasenko <[email protected]>
CC: David Woodhouse <[email protected]>
CC: Brian Norris <[email protected]>
CC: Dan Carpenter <[email protected]>
CC: Artem Bityutskiy <[email protected]>
CC: [email protected]
---
drivers/mtd/chips/cfi_cmdset_0020.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index 9a1a6ff..c740bd2 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -728,7 +728,7 @@ write_error:
}


-static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr)
+static int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr)
{
struct cfi_private *cfi = map->fldrv_priv;
map_word status, status_OK;
--
2.1.0

2016-03-30 17:36:17

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH] drivers/mtd/chips/cfi_cmdset_0020.c: Deinline do_write_buffer

Please check MAINTAINERS and resend to the appropriate list:

MEMORY TECHNOLOGY DEVICES (MTD)
M: David Woodhouse <[email protected]>
M: Brian Norris <[email protected]>
L: [email protected]