More macro cleanup. Use the system roundup2() macro instead of making

our own ROUNDUP() macro.

Suggested by:	bde
This commit is contained in:
Brooks Davis 2004-02-02 21:55:34 +00:00
parent 2082e6d249
commit ccb82468ac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125345

View File

@ -412,11 +412,9 @@ if_attach(struct ifnet *ifp)
namelen = strlen(ifp->if_xname);
masklen = offsetof(struct sockaddr_dl, sdl_data[0]) + namelen;
socksize = masklen + ifp->if_addrlen;
#define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1)))
if (socksize < sizeof(*sdl))
socksize = sizeof(*sdl);
socksize = ROUNDUP(socksize);
#undef ROUNDUP
socksize = roundup2(socksize, sizeof(long));
ifasize = sizeof(*ifa) + 2 * socksize;
ifa = malloc(ifasize, M_IFADDR, M_WAITOK | M_ZERO);
IFA_LOCK_INIT(ifa);