remove unnessesary 0-initilization of data in bss segment
PATCH 1/1 remove unnessesary 0-initilization of data in bss segment
This patch removes a couple of memset(.., 0, ..) of data in the bss segment.
Bye,
Patrick
pending/30_netfilter-nobssinit.patch +77 -0
@@ -0,0 +1,77 @@ +# This is a BitKeeper generated patch for the following project: +# Project Name: Linux kernel tree +# This patch format is intended for GNU patch command version 2.5 or higher. +# This patch includes the following deltas: +# ChangeSet 1.1058 -> 1.1059 +# net/ipv4/netfilter/ip_nat_ftp.c 1.6 -> 1.7 +# net/ipv4/netfilter/ip_conntrack_irc.c 1.5 -> 1.6 +# net/ipv4/netfilter/ipt_ULOG.c 1.6 -> 1.7 +# net/ipv4/netfilter/ip_conntrack_ftp.c 1.8 -> 1.9 +# net/ipv4/netfilter/ip_nat_irc.c 1.3 -> 1.4 +# +# The following is the BitKeeper ChangeSet Log +# -------------------------------------------- +# 03/03/27 [email protected] 1.1059 +# [NETFILTER]: remove unnessasary initilization to zero of data located in bss segment +# -------------------------------------------- +# +diff -Nru a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c +--- a/net/ipv4/netfilter/ip_conntrack_ftp.c Thu Mar 27 02:01:47 2003 ++++ b/net/ipv4/netfilter/ip_conntrack_ftp.c Thu Mar 27 02:01:47 2003 +@@ -405,7 +405,6 @@ + ports[0] = FTP_PORT; + + for (i = 0; (i < MAX_PORTS) && ports[i]; i++) { +- memset(&ftp[i], 0, sizeof(struct ip_conntrack_helper)); + ftp[i].tuple.src.u.tcp.port = htons(ports[i]); + ftp[i].tuple.dst.protonum = IPPROTO_TCP; + ftp[i].mask.src.u.tcp.port = 0xFFFF; +diff -Nru a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c +--- a/net/ipv4/netfilter/ip_conntrack_irc.c Thu Mar 27 02:01:47 2003 ++++ b/net/ipv4/netfilter/ip_conntrack_irc.c Thu Mar 27 02:01:47 2003 +@@ -259,8 +259,6 @@ + + for (i = 0; (i < MAX_PORTS) && ports[i]; i++) { + hlpr = &irc_helpers[i]; +- memset(hlpr, 0, +- sizeof(struct ip_conntrack_helper)); + hlpr->tuple.src.u.tcp.port = htons(ports[i]); + hlpr->tuple.dst.protonum = IPPROTO_TCP; + hlpr->mask.src.u.tcp.port = 0xFFFF; +diff -Nru a/net/ipv4/netfilter/ip_nat_ftp.c b/net/ipv4/netfilter/ip_nat_ftp.c +--- a/net/ipv4/netfilter/ip_nat_ftp.c Thu Mar 27 02:01:47 2003 ++++ b/net/ipv4/netfilter/ip_nat_ftp.c Thu Mar 27 02:01:47 2003 +@@ -306,9 +306,6 @@ + ports[0] = FTP_PORT; + + for (i = 0; (i < MAX_PORTS) && ports[i]; i++) { +- +- memset(&ftp[i], 0, sizeof(struct ip_nat_helper)); +- + ftp[i].tuple.dst.protonum = IPPROTO_TCP; + ftp[i].tuple.src.u.tcp.port = htons(ports[i]); + ftp[i].mask.dst.protonum = 0xFFFF; +diff -Nru a/net/ipv4/netfilter/ip_nat_irc.c b/net/ipv4/netfilter/ip_nat_irc.c +--- a/net/ipv4/netfilter/ip_nat_irc.c Thu Mar 27 02:01:47 2003 ++++ b/net/ipv4/netfilter/ip_nat_irc.c Thu Mar 27 02:01:47 2003 +@@ -243,9 +243,6 @@ + + for (i = 0; (i < MAX_PORTS) && ports[i] != 0; i++) { + hlpr = &ip_nat_irc_helpers[i]; +- memset(hlpr, 0, +- sizeof(struct ip_nat_helper)); +- + hlpr->tuple.dst.protonum = IPPROTO_TCP; + hlpr->tuple.src.u.tcp.port = htons(ports[i]); + hlpr->mask.src.u.tcp.port = 0xFFFF; +diff -Nru a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c +--- a/net/ipv4/netfilter/ipt_ULOG.c Thu Mar 27 02:01:47 2003 ++++ b/net/ipv4/netfilter/ipt_ULOG.c Thu Mar 27 02:01:47 2003 +@@ -322,7 +322,6 @@ + + /* initialize ulog_buffers */ + for (i = 0; i < ULOG_MAXNLGROUPS; i++) { +- memset(&ulog_buffers[i], 0, sizeof(ulog_buff_t)); + init_timer(&ulog_buffers[i].timer); + ulog_buffers[i].timer.function = ulog_timer; + ulog_buffers[i].timer.data = i;
pending/30_netfilter-nobssinit.patch.help +5 -0
@@ -0,0 +1,5 @@ +Author: Patrick McHardy <[email protected]> +Status: Working + +This patch removes a couple of unneeded zero-initializations of data +located in the bss segment.
Hi Patrick,
Quoted 2 lines · Patrick McHardy
This patch removes a couple of
memset(.., 0, ..)of data in the bss segment.
Thank you the patch, I'm going to integrate it with C99 initialization fixes.
Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary