* [PATCH] dccp: make const array error_code static
@ 2017-07-13 11:22 Colin King
2017-07-13 16:24 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-07-13 11:22 UTC (permalink / raw)
To: Gerrit Renker, David S . Miller, dccp, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Don't populate array error_code on the stack but make it static. Makes
the object code smaller by almost 250 bytes:
Before:
text data bss dec hex filename
10366 983 0 11349 2c55 net/dccp/input.o
After:
text data bss dec hex filename
10161 1039 0 11200 2bc0 net/dccp/input.o
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/dccp/input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dccp/input.c b/net/dccp/input.c
index 4a05d7876850..fa6be9750bb4 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -126,7 +126,7 @@ static int dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb)
static u16 dccp_reset_code_convert(const u8 code)
{
- const u16 error_code[] = {
+ static const u16 error_code[] = {
[DCCP_RESET_CODE_CLOSED] = 0, /* normal termination */
[DCCP_RESET_CODE_UNSPECIFIED] = 0, /* nothing known */
[DCCP_RESET_CODE_ABORTED] = ECONNRESET,
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dccp: make const array error_code static
2017-07-13 11:22 [PATCH] dccp: make const array error_code static Colin King
@ 2017-07-13 16:24 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-07-13 16:24 UTC (permalink / raw)
To: colin.king; +Cc: gerrit, dccp, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Thu, 13 Jul 2017 12:22:24 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate array error_code on the stack but make it static. Makes
> the object code smaller by almost 250 bytes:
>
> Before:
> text data bss dec hex filename
> 10366 983 0 11349 2c55 net/dccp/input.o
>
> After:
> text data bss dec hex filename
> 10161 1039 0 11200 2bc0 net/dccp/input.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-13 16:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13 11:22 [PATCH] dccp: make const array error_code static Colin King
2017-07-13 16:24 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).