From patchwork Mon Sep 11 12:54:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9947337 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 8BAA36024A for ; Mon, 11 Sep 2017 12:54:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7181928BF4 for ; Mon, 11 Sep 2017 12:54:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 667DF28BF6; Mon, 11 Sep 2017 12:54:51 +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 289FD28BF4 for ; Mon, 11 Sep 2017 12:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbdIKMyi (ORCPT ); Mon, 11 Sep 2017 08:54:38 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34966 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbdIKMyh (ORCPT ); Mon, 11 Sep 2017 08:54:37 -0400 Received: by mail-pg0-f67.google.com with SMTP id j16so1487479pga.2; Mon, 11 Sep 2017 05:54:37 -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=y0TwiwbGKQLP3zwHb8RbE0tM5bnUpZPsOsjszbyNMJs=; b=TwZZ2GsJxsAoWtbnBdgYPlvNTQJ/8lg6Nd0hB2oEncIDHoQzGnokPwMIV+CJnMD7jk 2Q7ebh4AnzKKrJ7VlSXPj65ooFllJEShOfUoWWU7v3fO0NCZYHY/7UloX4HeiG4ujVGQ HLqI0HD6p02fEt6U4w0xQFmym2rjVrvjv3PZT+fPLEh5PuZI0LlT5/5cbYK9zhUjizkA jZzVgEC69y5MZQa25brJzB7HUcJjB172Sh/tcO6v+zcgNFb/b5nJf0goqPAXBlzyNA5t DDlUZMcULnrW0kMkqt3H/2ThVkaVPEk9ctZkKdTGxOux+gA1EKjXl7x2HjbhcO+0O9FD 9JZA== 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=y0TwiwbGKQLP3zwHb8RbE0tM5bnUpZPsOsjszbyNMJs=; b=J6MkToKvTQP5rxfA0ZF8qHeYzSXQXHB40eeU+g5h6E3jYldvwGGwiymHMHOfW43ddm Pak058SDpzcEAmQA/ZJ1DS7VAEkxtwzcb4KWLIwLwccYOsSPSTqSzClcZw2ocVQnDj4v azOJnDc89+X+uM/fdECajXeteyH4OWDFK8vL/9EJqHf9FpdlhLqTk3yBJLcJ8iSG2obn hfd2vYFcQBssC/BMRxB/Dl3N6aV9m4wElyqGSLLMW2SYZBG5Di8ExawbVesGqqxEbgVV tvj17YuMuWjiwhroSCk6dASjDATd2r1xSSK+oYgJBBzqOOnQNBPADpOX8XYcng5FUqLc r8AQ== X-Gm-Message-State: AHPjjUgPWHQROVgUQZ7EcAoebzH5fA55OgOP1kmBqp4kG6vtZxO4ZtAI q08qK5b+vHDV9Q== X-Google-Smtp-Source: ADKCNb6M4nI6OMb2HCGzxj2oUMqCUv4VS37lAvEEO8xcXsiT5pcAN9eXvv9alJA5PrI63/bbeJYPBQ== X-Received: by 10.101.92.204 with SMTP id b12mr11604640pgt.54.1505134477316; Mon, 11 Sep 2017 05:54:37 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id l66sm15411443pfl.156.2017.09.11.05.54.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Sep 2017 05:54:36 -0700 (PDT) From: Himanshu Jha To: martin.petersen@oracle.com Cc: jejb@linux.vnet.ibm.com, qla2xxx-upstream@qlogic.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Himanshu Jha Subject: [PATCH] scsi: qla2xxx: remove unnecessary call to memset Date: Mon, 11 Sep 2017 18:24:22 +0530 Message-Id: <1505134462-789-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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/scsi/qla2xxx/qla_init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index b5b48dd..54c1d63 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -7917,7 +7917,6 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos, "Failed to allocate memory for queue pair.\n"); return NULL; } - memset(qpair, 0, sizeof(struct qla_qpair)); qpair->hw = vha->hw; qpair->vha = vha;