[PATCH 39] net/ipv4/ip_options.c: kmalloc + memset conversion to kzalloc

2007-07-31 Thread Mariusz Kozlowski
Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]

 net/ipv4/ip_options.c | 15425 - 15368 (-57 bytes)
 net/ipv4/ip_options.o | 133668 - 133588 (-80 bytes)

 net/ipv4/ip_options.c |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

--- linux-2.6.23-rc1-mm1-a/net/ipv4/ip_options.c2007-07-26 
13:07:44.0 +0200
+++ linux-2.6.23-rc1-mm1-b/net/ipv4/ip_options.c2007-07-31 
15:17:22.0 +0200
@@ -513,11 +513,8 @@ void ip_options_undo(struct ip_options *

 static struct ip_options *ip_options_get_alloc(const int optlen)
 {
-   struct ip_options *opt = kmalloc(sizeof(*opt) + ((optlen + 3)  ~3),
-GFP_KERNEL);
-   if (opt)
-   memset(opt, 0, sizeof(*opt));
-   return opt;
+   return kzalloc(sizeof(struct ip_options) + ((optlen + 3)  ~3),
+  GFP_KERNEL);
 }

 static int ip_options_get_finish(struct ip_options **optp,
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39] net/ipv4/ip_options.c: kmalloc + memset conversion to kzalloc

2007-07-31 Thread David Miller
From: Mariusz Kozlowski [EMAIL PROTECTED]
Date: Tue, 31 Jul 2007 20:16:59 +0200

 Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]

Applied, but note that this patch changes behavior, previously
only the ip_options structure base was cleared out, but now
the whole memory region is cleared.

I think it's OK for this case, but I'm just making note of it.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 39] net/ipv4/ip_options.c: kmalloc + memset conversion to kzalloc

2007-07-31 Thread Mariusz Kozlowski
 Applied, but note that this patch changes behavior, previously
 only the ip_options structure base was cleared out, but now
 the whole memory region is cleared.
 
 I think it's OK for this case, but I'm just making note of it.

Agrh. Sorry. I must have overlook this. Feel free to drop it if
you think its not worth it :-)

Thanks,

Mariusz
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html