svn commit: r245537 - user/ae/inet6/sys/netinet6
Andrey V. Elsukov
ae at FreeBSD.org
Thu Jan 17 04:32:39 UTC 2013
Author: ae
Date: Thu Jan 17 04:32:38 2013
New Revision: 245537
URL: http://svnweb.freebsd.org/changeset/base/245537
Log:
Remove redundant casts and use sizeof(object) instead of sizeof(typename).
Suggested by: bde
Modified:
user/ae/inet6/sys/netinet6/in6.c
user/ae/inet6/sys/netinet6/scope6.c
Modified: user/ae/inet6/sys/netinet6/in6.c
==============================================================================
--- user/ae/inet6/sys/netinet6/in6.c Thu Jan 17 04:20:53 2013 (r245536)
+++ user/ae/inet6/sys/netinet6/in6.c Thu Jan 17 04:32:38 2013 (r245537)
@@ -2703,13 +2703,11 @@ in6_domifattach(struct ifnet *ifp)
{
struct in6_ifextra *ext;
- ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR,
+ ext = malloc(sizeof(*ext), M_IFADDR, M_WAITOK | M_ZERO);
+ ext->in6_ifstat = malloc(sizeof(*ext->in6_ifstat), M_IFADDR,
+ M_WAITOK | M_ZERO);
+ ext->icmp6_ifstat = malloc(sizeof(*ext->icmp6_ifstat), M_IFADDR,
M_WAITOK | M_ZERO);
- ext->in6_ifstat = (struct in6_ifstat *)malloc(
- sizeof(struct in6_ifstat), M_IFADDR, M_WAITOK | M_ZERO);
- ext->icmp6_ifstat =
- (struct icmp6_ifstat *)malloc(sizeof(struct icmp6_ifstat),
- M_IFADDR, M_WAITOK | M_ZERO);
ext->nd_ifinfo = nd6_ifattach(ifp);
ext->scope6_id = scope6_ifattach(ifp);
Modified: user/ae/inet6/sys/netinet6/scope6.c
==============================================================================
--- user/ae/inet6/sys/netinet6/scope6.c Thu Jan 17 04:20:53 2013 (r245536)
+++ user/ae/inet6/sys/netinet6/scope6.c Thu Jan 17 04:32:38 2013 (r245537)
@@ -95,9 +95,7 @@ scope6_ifattach(struct ifnet *ifp)
{
struct scope6_id *sid;
- sid = (struct scope6_id *)malloc(sizeof(*sid), M_IFADDR,
- M_WAITOK | M_ZERO);
-
+ sid = malloc(sizeof(*sid), M_IFADDR, M_WAITOK | M_ZERO);
/*
* XXX: IPV6_ADDR_SCOPE_xxx macros are not standard.
* Should we rather hardcode here?
More information about the svn-src-user
mailing list