[PATCH 1/3] staging: wilc1000: coreconfigurator.c: remove WILC_MALLOC
Greg KH
gregkh at linuxfoundation.org
Thu Jul 23 21:52:14 UTC 2015
On Thu, Jul 23, 2015 at 08:19:17PM +0900, Chaehyun Lim wrote:
> Use kmalloc and kmalloc_array instead of WILC_MALLOC.
>
> Signed-off-by: Chaehyun Lim <chaehyun.lim at gmail.com>
> ---
> drivers/staging/wilc1000/coreconfigurator.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index b069614..7e2b2ab41 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -674,7 +674,7 @@ s32 CoreConfiguratorInit(void)
> sema_init(&SemHandleSendPkt, 1);
> sema_init(&SemHandlePktResp, 0);
>
> - gps8ConfigPacket = (s8 *)WILC_MALLOC(MAX_PACKET_BUFF_SIZE);
> + gps8ConfigPacket = kmalloc(MAX_PACKET_BUFF_SIZE, GFP_ATOMIC);
I know this is what WILC_MALLOC() did, but should this really be
GFP_ATOMIC?
> if (gps8ConfigPacket == NULL) {
> PRINT_ER("failed in gps8ConfigPacket allocation\n");
> s32Error = WILC_NO_MEM;
> @@ -811,7 +811,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
> u32 u32Tsf_Lo;
> u32 u32Tsf_Hi;
>
> - pstrNetworkInfo = (tstrNetworkInfo *)WILC_MALLOC(sizeof(tstrNetworkInfo));
> + pstrNetworkInfo = kmalloc(sizeof(tstrNetworkInfo), GFP_ATOMIC);
Same here. And everywhere else you changed this code, please review and
resend.
thanks,
greg k-h
More information about the devel
mailing list