devres: combine function devm_ioremap*
authorYisheng Xie <xieyisheng1@huawei.com>
Mon, 29 Jan 2018 11:48:16 +0000 (19:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Mar 2018 17:08:55 +0000 (18:08 +0100)
commit1b723413aada7383a4b24ded93ed26eee1b3a3ca
tree924e694e844253889ad136d1e738f91c67bb94ad
parentf87deada80fe483e2286e29cd866dc66ddc2b6bc
devres: combine function devm_ioremap*

When I tried to use devm_ioremap function and review related
code, I found devm_ioremap_* almost have the similar realize
with each other, which can be combined.

In the former version, I have tried to kill ioremap_cache to
reduce the size of devres, which can not work for ioremap is
not the same as ioremap_nocache in some ARCHs likes ia64.
Therefore, as the suggestion of Christophe, I introduce a help
function __devm_ioremap, let devm_ioremap* inline and call
__devm_ioremap with different devm_ioremap_type.

After apply the patch, the size of devres.o can be reduce from
8216 Bytes to 8052 Bytes in my compile environment.

Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Suggested-by: Christophe LEROY <christophe.leroy@c-s.fr>
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Reviewed-by: Christophe LEROY <christophe.leroy@c-s.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/devres.c