]> Pileus Git - ~andy/linux/commitdiff
net: sctp: get rid of t_new macro for kzalloc
authorDaniel Borkmann <dborkman@redhat.com>
Mon, 17 Jun 2013 09:40:04 +0000 (11:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Jun 2013 00:08:04 +0000 (17:08 -0700)
t_new rather obfuscates things where everyone else is using actual
function names instead of that macro, so replace it with kzalloc,
which is the function t_new wraps.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/sctp.h
net/sctp/associola.c
net/sctp/bind_addr.c
net/sctp/endpointola.c
net/sctp/ipv6.c
net/sctp/protocol.c
net/sctp/transport.c

index cd89510eab2a44d405c2cba2817b3b7ae863306e..b9f136ad5a5aa2025367a712849987fecd5d0eb3 100644 (file)
@@ -575,9 +575,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\
 /* Round an int up to the next multiple of 4.  */
 #define WORD_ROUND(s) (((s)+3)&~3)
 
-/* Make a new instance of type.  */
-#define t_new(type, flags)     kzalloc(sizeof(type), flags)
-
 /* Compare two timevals.  */
 #define tv_lt(s, t) \
    (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec))
index 756025c98e853ee3b118e648fa3af3bf14f8ca3e..bf6e6bd553c06e2a3837e2475f0eee5f56b358f0 100644 (file)
@@ -355,7 +355,7 @@ struct sctp_association *sctp_association_new(const struct sctp_endpoint *ep,
 {
        struct sctp_association *asoc;
 
-       asoc = t_new(struct sctp_association, gfp);
+       asoc = kzalloc(sizeof(*asoc), gfp);
        if (!asoc)
                goto fail;
 
index 41145fe31813bc70907a9bdf9bba92886246b5b6..64977ea0f9c55e02988377ef6e2de73693607dea 100644 (file)
@@ -162,7 +162,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
        struct sctp_sockaddr_entry *addr;
 
        /* Add the address to the bind address list.  */
-       addr = t_new(struct sctp_sockaddr_entry, gfp);
+       addr = kzalloc(sizeof(*addr), gfp);
        if (!addr)
                return -ENOMEM;
 
index 5fbd7bc6bb11077f8af91bf01ea8403c5087c31e..a8b26741c0af868e6aab9277f01d311f54635c6b 100644 (file)
@@ -192,9 +192,10 @@ struct sctp_endpoint *sctp_endpoint_new(struct sock *sk, gfp_t gfp)
        struct sctp_endpoint *ep;
 
        /* Build a local endpoint. */
-       ep = t_new(struct sctp_endpoint, gfp);
+       ep = kzalloc(sizeof(*ep), gfp);
        if (!ep)
                goto fail;
+
        if (!sctp_endpoint_init(ep, sk, gfp))
                goto fail_init;
 
index fffc7b62a9a8ef5067085124094b84c3679589ed..4f3e13b31fcc5e71f35c71235cfbe90f3bf594bd 100644 (file)
@@ -402,7 +402,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
        read_lock_bh(&in6_dev->lock);
        list_for_each_entry(ifp, &in6_dev->addr_list, if_list) {
                /* Add the address to the local list.  */
-               addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
+               addr = kzalloc(sizeof(*addr), GFP_ATOMIC);
                if (addr) {
                        addr->a.v6.sin6_family = AF_INET6;
                        addr->a.v6.sin6_port = 0;
index eaee00c61139b974572e8c4aed425176f3ae2894..fad7d1b67be564b4655ebd076d12dfc40ff734bc 100644 (file)
@@ -153,7 +153,7 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist,
 
        for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
                /* Add the address to the local list.  */
-               addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
+               addr = kzalloc(sizeof(*addr), GFP_ATOMIC);
                if (addr) {
                        addr->a.v4.sin_family = AF_INET;
                        addr->a.v4.sin_port = 0;
index 098f1d5f769e264b73aa8b3800ccf3a4eeb75c92..5d3c71bbd197b1804273f26658273c86fa9f9b4a 100644 (file)
@@ -116,7 +116,7 @@ struct sctp_transport *sctp_transport_new(struct net *net,
 {
        struct sctp_transport *transport;
 
-       transport = t_new(struct sctp_transport, gfp);
+       transport = kzalloc(sizeof(*transport), gfp);
        if (!transport)
                goto fail;