[PATCH] x86/mca.c: malloc with correct pointer type
Meyer, Conrad
conrad.meyer at isilon.com
Thu Mar 13 22:14:01 UTC 2014
> From: John Baldwin [jhb at freebsd.org]
> Sent: Thursday, March 13, 2014 10:57 AM
> To: freebsd-hackers at freebsd.org
> Cc: Meyer, Conrad
> Subject: Re: [PATCH] x86/mca.c: malloc with correct pointer type
>
> > - cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **),
> > - M_MCA, M_WAITOK);
> > + cmc_state = malloc((mp_maxid + 1) * sizeof(*cmc_state), M_MCA,
> > + M_WAITOK);
> > for (i = 0; i <= mp_maxid; i++)
> > cmc_state[i] = malloc(sizeof(struct cmc_state) * mca_banks,
> > M_MCA, M_WAITOK | M_ZERO);
>
> I would rather do 'struct cmc_state *' as I think it is clearer to read, but
> the change is correct. Thanks!
>
> --
> John Baldwin
Sounds fine to me.
Thanks,
Conrad
More information about the freebsd-hackers
mailing list