From patchwork Fri Aug 26 09:39:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Bhivare X-Patchwork-Id: 9301061 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 96050607D8 for ; Fri, 26 Aug 2016 09:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42626295E0 for ; Fri, 26 Aug 2016 09:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30371295FD; Fri, 26 Aug 2016 09:39:37 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 BB9E9295FC for ; Fri, 26 Aug 2016 09:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752781AbcHZJjf (ORCPT ); Fri, 26 Aug 2016 05:39:35 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34347 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752596AbcHZJjc (ORCPT ); Fri, 26 Aug 2016 05:39:32 -0400 Received: by mail-pa0-f47.google.com with SMTP id fi15so25839365pac.1 for ; Fri, 26 Aug 2016 02:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QtHfPfludYHpOlxgwQmzuN41ZN/TfOQqEQEbuQ5hZiM=; b=NH4vkbTN6kQTHswPNem4RooIcOYCczIBKyFD52rUh52ITH6+i2x88nkLOnDAFLU2R7 5xiEKir1SJnRNBDKqHQXQbMk+J6fH94/gSZ7rf6fT3O+Kfel952WU8rwOJbXZ+Q6kxcD 8UdzYb1twx44Kf17S4CFlXCNMye+pKQaCQwuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QtHfPfludYHpOlxgwQmzuN41ZN/TfOQqEQEbuQ5hZiM=; b=Wa6U6Z0dNaWn2NnR+L8EBHMU309kq5R65IEn6wOr+0qrHJUX03J1pQp5NMd1uA4vg6 nQMZc/+gWZ4W1K2HV6gJyNcbrzcZCEI7HIJ4F+7iY1lZNeWkwz61yd6ZgI846USKgAcy mQOIhDi7GLicmIFz1WM+6x85OrkLb6sl4+vhueBrvkO158hBhpWn1Bu8HT8DdRWfnDSV mTxI8Rb6mSTlZC+HD1Mp0uh4+EI2GbgEISlaoM+m0grtcyubn7/w238VfJ6P8uCL0QCy V2Y6izftsM9J8HYh69aWmZsP5TT4MZMgU2VSCiK2h/P22d9Jd4chqprv4SR3QXzTWD69 eaYg== X-Gm-Message-State: AE9vXwMQugpkOFMoPRMibNayY9tu+tqDS5ZTLh9melaUCq9xzc42+E5k/npqHebRaw7E+qYp X-Received: by 10.66.49.67 with SMTP id s3mr4280089pan.100.1472204364512; Fri, 26 Aug 2016 02:39:24 -0700 (PDT) Received: from android.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id ty6sm27100139pac.18.2016.08.26.02.39.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Aug 2016 02:39:23 -0700 (PDT) From: Jitendra Bhivare To: christophe.jaillet@wanadoo.fr, julia.lawall@lip6.fr, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Jitendra Bhivare Subject: [PATCH v2 2/3] be2iscsi: Remove redundant iscsi_wrb desc memset Date: Fri, 26 Aug 2016 15:09:07 +0530 Message-Id: <1472204348-5960-3-git-send-email-jitendra.bhivare@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472204348-5960-1-git-send-email-jitendra.bhivare@broadcom.com> References: <1472204348-5960-1-git-send-email-jitendra.bhivare@broadcom.com> 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 alloc_wrb_handle already does memset zero of iscsi_wrb descriptor so remove redundant memset in WRB submission paths. Add pwrb_handle NULL check before memsett'ing pwrb. Signed-off-by: Jitendra Bhivare Reviewed-by: Johannes Thumshirn --- drivers/scsi/be2iscsi/be_main.c | 5 +++-- drivers/scsi/be2iscsi/be_mgmt.c | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index b30db87..6a6906f 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -967,7 +967,9 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context, else pwrb_context->alloc_index++; spin_unlock_bh(&pwrb_context->wrb_lock); - memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb)); + + if (pwrb_handle) + memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb)); return pwrb_handle; } @@ -4718,7 +4720,6 @@ static int beiscsi_mtask(struct iscsi_task *task) cid = beiscsi_conn->beiscsi_conn_cid; pwrb = io_task->pwrb_handle->pwrb; - memset(pwrb, 0, sizeof(*pwrb)); if (is_chip_be2_be3r(phba)) { AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb, diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 3ac7b88..b9ff939 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c @@ -1350,7 +1350,6 @@ void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params, { struct iscsi_wrb *pwrb = pwrb_handle->pwrb; - memset(pwrb, 0, sizeof(*pwrb)); AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, max_send_data_segment_length, pwrb, params->dw[offsetof(struct amap_beiscsi_offload_params, @@ -1422,8 +1421,6 @@ void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params, { struct iscsi_wrb *pwrb = pwrb_handle->pwrb; - memset(pwrb, 0, sizeof(*pwrb)); - AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb_v2, max_burst_length, pwrb, params->dw[offsetof (struct amap_beiscsi_offload_params,