From patchwork Thu Jul 30 11:41:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 6901991 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 949C7C05AC for ; Thu, 30 Jul 2015 11:41:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA6BA20567 for ; Thu, 30 Jul 2015 11:41:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B85A20528 for ; Thu, 30 Jul 2015 11:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753680AbbG3LlT (ORCPT ); Thu, 30 Jul 2015 07:41:19 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:36013 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbbG3LlS (ORCPT ); Thu, 30 Jul 2015 07:41:18 -0400 Received: by pdjr16 with SMTP id r16so23802621pdj.3 for ; Thu, 30 Jul 2015 04:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c6c+m8aZR/kn6W/6Wdt1lMKXc7AQKSEspMFAQ3mEFQo=; b=xvtDjaHBDtv0IFyBnyuAk4zJYu7gsS9ufn0/MFsO6iPC9btq6FbjQBrYO41WvmnqrV 53Uh9e7BIF/UPwW3lSNBkx3+jokfXc609w3y+utssYdb3hT5B6ETRu9QttgnAFy/3dQt jef0kOv8zzqGwbO2nPvdKl3NP1AlxJ8wRH2Z1QiLJAjkGLkBTGh5z464e3eWa3hEbTvd rGo3mnuYUw5klGpyve2e49FtUJpOduToeFKAGep8nBJNTJBOeQMHh5VkOURLw524rd8e MXDbGN/WFo7dwnK/2OyNXBKGQ+sOqMgu2FRKKq+sBFjRYDpHlTEDJVc17qSlrLHbGrTw 9c1w== X-Received: by 10.70.87.195 with SMTP id ba3mr106748316pdb.154.1438256477648; Thu, 30 Jul 2015 04:41:17 -0700 (PDT) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id or7sm1834117pdb.9.2015.07.30.04.41.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jul 2015 04:41:16 -0700 (PDT) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, dean.lee@atmel.com, chris.park@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [RESEND V2 1/3] staging: wilc1000: coreconfigurator.c: remove WILC_MALLOC Date: Thu, 30 Jul 2015 20:41:03 +0900 Message-Id: <1438256465-19540-2-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438256465-19540-1-git-send-email-chaehyun.lim@gmail.com> References: <1438256465-19540-1-git-send-email-chaehyun.lim@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use kmalloc and kmalloc_array instead of WILC_MALLOC. Signed-off-by: Chaehyun Lim --- 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 342a336..37e09b8 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_KERNEL); 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_KERNEL); WILC_memset((void *)(pstrNetworkInfo), 0, sizeof(tstrNetworkInfo)); pstrNetworkInfo->s8rssi = pu8WidVal[0]; @@ -861,7 +861,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); if (u16IEsLen > 0) { - pstrNetworkInfo->pu8IEs = (u8 *)WILC_MALLOC(u16IEsLen); + pstrNetworkInfo->pu8IEs = kmalloc(u16IEsLen, GFP_KERNEL); WILC_memset((void *)(pstrNetworkInfo->pu8IEs), 0, u16IEsLen); WILC_memcpy(pstrNetworkInfo->pu8IEs, pu8IEs, u16IEsLen); @@ -928,7 +928,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, u8 *pu8IEs = 0; u16 u16IEsLen = 0; - pstrConnectRespInfo = (tstrConnectRespInfo *)WILC_MALLOC(sizeof(tstrConnectRespInfo)); + pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL); WILC_memset((void *)(pstrConnectRespInfo), 0, sizeof(tstrConnectRespInfo)); /* u16AssocRespLen = pu8Buffer[0]; */ @@ -948,7 +948,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, pu8IEs = &pu8Buffer[CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; u16IEsLen = u16AssocRespLen - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN); - pstrConnectRespInfo->pu8RespIEs = (u8 *)WILC_MALLOC(u16IEsLen); + pstrConnectRespInfo->pu8RespIEs = kmalloc(u16IEsLen, GFP_KERNEL); WILC_memset((void *)(pstrConnectRespInfo->pu8RespIEs), 0, u16IEsLen); WILC_memcpy(pstrConnectRespInfo->pu8RespIEs, pu8IEs, u16IEsLen); @@ -1017,7 +1017,8 @@ s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ } } - pstrSurveyResults = (wid_site_survey_reslts_s *)WILC_MALLOC(u32SurveyResultsCount * sizeof(wid_site_survey_reslts_s)); + pstrSurveyResults = kmalloc_array(u32SurveyResultsCount, + sizeof(wid_site_survey_reslts_s), GFP_KERNEL); if (pstrSurveyResults == NULL) { u32SurveyResultsCount = 0; WILC_ERRORREPORT(s32Error, WILC_NO_MEM);