Skip to content

Commit 939cfa7

Browse files
Daniel Borkmanndavem330
authored andcommitted
net: sctp: get rid of t_new macro for kzalloc
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>
1 parent 32bc9b4 commit 939cfa7

7 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎include/net/sctp/sctp.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\
575575
/* Round an int up to the next multiple of 4. */
576576
#define WORD_ROUND(s) (((s)+3)&~3)
577577

578-
/* Make a new instance of type. */
579-
#define t_new(type, flags) kzalloc(sizeof(type), flags)
580-
581578
/* Compare two timevals. */
582579
#define tv_lt(s, t) \
583580
(s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec))

‎net/sctp/associola.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ struct sctp_association *sctp_association_new(const struct sctp_endpoint *ep,
355355
{
356356
struct sctp_association *asoc;
357357

358-
asoc = t_new(struct sctp_association, gfp);
358+
asoc = kzalloc(sizeof(*asoc), gfp);
359359
if (!asoc)
360360
goto fail;
361361

‎net/sctp/bind_addr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
162162
struct sctp_sockaddr_entry *addr;
163163

164164
/* Add the address to the bind address list. */
165-
addr = t_new(struct sctp_sockaddr_entry, gfp);
165+
addr = kzalloc(sizeof(*addr), gfp);
166166
if (!addr)
167167
return -ENOMEM;
168168

‎net/sctp/endpointola.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ struct sctp_endpoint *sctp_endpoint_new(struct sock *sk, gfp_t gfp)
192192
struct sctp_endpoint *ep;
193193

194194
/* Build a local endpoint. */
195-
ep = t_new(struct sctp_endpoint, gfp);
195+
ep = kzalloc(sizeof(*ep), gfp);
196196
if (!ep)
197197
goto fail;
198+
198199
if (!sctp_endpoint_init(ep, sk, gfp))
199200
goto fail_init;
200201

‎net/sctp/ipv6.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static void sctp_v6_copy_addrlist(struct list_head *addrlist,
402402
read_lock_bh(&in6_dev->lock);
403403
list_for_each_entry(ifp, &in6_dev->addr_list, if_list) {
404404
/* Add the address to the local list. */
405-
addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
405+
addr = kzalloc(sizeof(*addr), GFP_ATOMIC);
406406
if (addr) {
407407
addr->a.v6.sin6_family = AF_INET6;
408408
addr->a.v6.sin6_port = 0;

‎net/sctp/protocol.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist,
153153

154154
for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
155155
/* Add the address to the local list. */
156-
addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC);
156+
addr = kzalloc(sizeof(*addr), GFP_ATOMIC);
157157
if (addr) {
158158
addr->a.v4.sin_family = AF_INET;
159159
addr->a.v4.sin_port = 0;

‎net/sctp/transport.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct sctp_transport *sctp_transport_new(struct net *net,
116116
{
117117
struct sctp_transport *transport;
118118

119-
transport = t_new(struct sctp_transport, gfp);
119+
transport = kzalloc(sizeof(*transport), gfp);
120120
if (!transport)
121121
goto fail;
122122

0 commit comments

Comments
 (0)