From patchwork Mon Sep 11 12:46:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9947331 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68DAE6024A for ; Mon, 11 Sep 2017 12:46:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 483F628BEA for ; Mon, 11 Sep 2017 12:46:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D0E728BED; Mon, 11 Sep 2017 12:46:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBCAB28BEA for ; Mon, 11 Sep 2017 12:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbdIKMqX (ORCPT ); Mon, 11 Sep 2017 08:46:23 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36177 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbdIKMqV (ORCPT ); Mon, 11 Sep 2017 08:46:21 -0400 Received: by mail-pf0-f196.google.com with SMTP id f84so4859129pfj.3; Mon, 11 Sep 2017 05:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6orI+gjABT3+IU4ZAxp+uQ9X0QBsJbECNQ8kGgFz9Ds=; b=iD7cnZonTn7PgYm1CWOzJbPwi/Jo/p9cjCEd3TNgDy65dORQkojMPzcMMadfCGjONH gYMZMITlVXehGDdk+eUpVA4C5ejaiGEmj30WL32mREBjLxbrGy47RVpZCbQlLvZ93nC9 XQT01cgKy+3Fu/MNpD8PCsZEStYrJG95Th7AkXAv6s5OhhDl6Qi2SoNyp1v5fqF3oXMY SjY9kH9XXGcB5nrAMBl+SYR9TO5bfqxxLe161z97AxR0iCQli4Ws7y8omoEnhA/j/jw8 NrmRwj/mUEUxT75aI6a1Qpo3n8d3MJQbe/kgRl4WLh3zfbTR+x1pvUk1gS+e41D+fEZS JGnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6orI+gjABT3+IU4ZAxp+uQ9X0QBsJbECNQ8kGgFz9Ds=; b=i7Ky11/zx7LMMM1c9JQaN1uaUxjq8XrqL15nh+piCSo4oIM+GVm87g9UQsDVqJEUnT UVMaMKFvt+OlwrlCUmIc9fM0yxZ74JRCRKOsMvRc/6o1JSqUOgEW1Ys1XwO9OfrTQC5q DOMqy/opBUuCJXYmI7a3qk8AKZoNKbI/vSxC2zt5o5G0KFtYlzTY8OzasxAe6Bb9d2aO cLiEABjrsB8xlIZU5/mg/lNUmdEaulUU2or9ZWSzcvo3h4srfg0nMEmTcDwvVG7IJ5tY cNp+aK880EFZH5Uy0DHh1Txcimm0vdJGwoUalFGYdTa0q9HdEym9W9AQuGWM0wj70tz+ Qt6w== X-Gm-Message-State: AHPjjUjP2dlQOI9VPxFzgJ9rxoHRj9BmrJclyAtzAE5B4Xq84o1uAY1S Hd4taEL1eInfkw== X-Google-Smtp-Source: AOwi7QAoqed3MnEKcudZS4GWCoTXg+4CDmAI5d2HtLSiD3I4FR3pHAV+eMna+x/+q+u8SwnF19U1Yw== X-Received: by 10.98.95.1 with SMTP id t1mr246517pfb.217.1505133981257; Mon, 11 Sep 2017 05:46:21 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id 13sm15799503pfm.138.2017.09.11.05.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Sep 2017 05:46:20 -0700 (PDT) From: Himanshu Jha To: amitkarwar@gmail.com Cc: nishants@marvell.com, gbhat@marvell.com, huxm@marvell.com, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Himanshu Jha Subject: [PATCH] mwifiex: remove unnecessary call to memset Date: Mon, 11 Sep 2017 18:16:04 +0530 Message-Id: <1505133964-376-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP call to memset to assign 0 value immediately after allocating memory with kzalloc is unnecesaary as kzalloc allocates the memory filled with 0 value. Semantic patch used to resolve this issue: @@ expression e,e2; constant c; statement S; @@ e = kzalloc(e2, c); if(e == NULL) S - memset(e, 0, e2); Signed-off-by: Himanshu Jha --- drivers/net/wireless/marvell/mwifiex/scan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c index c9d41ed..8838b88 100644 --- a/drivers/net/wireless/marvell/mwifiex/scan.c +++ b/drivers/net/wireless/marvell/mwifiex/scan.c @@ -1936,8 +1936,6 @@ mwifiex_active_scan_req_for_passive_chan(struct mwifiex_private *priv) if (!user_scan_cfg) return -ENOMEM; - memset(user_scan_cfg, 0, sizeof(*user_scan_cfg)); - for (id = 0; id < MWIFIEX_USER_SCAN_CHAN_MAX; id++) { if (!priv->hidden_chan[id].chan_number) break;