From patchwork Thu Feb 16 05:56:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Amrani, Ram" X-Patchwork-Id: 9576515 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 D587660244 for ; Thu, 16 Feb 2017 05:56:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8DD0285AA for ; Thu, 16 Feb 2017 05:56:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDEB9285AD; Thu, 16 Feb 2017 05:56:40 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 7218A285AA for ; Thu, 16 Feb 2017 05:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440AbdBPF4j (ORCPT ); Thu, 16 Feb 2017 00:56:39 -0500 Received: from mx0b-0016ce01.pphosted.com ([67.231.156.153]:34375 "EHLO mx0b-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752609AbdBPF4j (ORCPT ); Thu, 16 Feb 2017 00:56:39 -0500 Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1G5uY47023038; Wed, 15 Feb 2017 21:56:34 -0800 Received: from avcashub1.qlogic.com ([198.186.0.116]) by mx0b-0016ce01.pphosted.com with ESMTP id 28n3p107ue-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 15 Feb 2017 21:56:34 -0800 Received: from lb-tlvb-ramrani.il.qlogic.org (10.185.6.119) by qlc.com (10.1.4.191) with Microsoft SMTP Server id 14.3.235.1; Wed, 15 Feb 2017 21:56:34 -0800 From: Ram Amrani To: CC: , , , Ram Amrani Subject: [PATCH rdma-core 2/3] libqedr: Remove redundant memset Date: Thu, 16 Feb 2017 07:56:10 +0200 Message-ID: <1487224571-18627-3-git-send-email-Ram.Amrani@cavium.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1487224571-18627-1-git-send-email-Ram.Amrani@cavium.com> References: <1487224571-18627-1-git-send-email-Ram.Amrani@cavium.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8440 signatures=670815 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702160061 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The memset was invoked with a size of zero. But anyway, zeroing of the CQ/RQ/SQ is not required since mmap is used with MAP_ANONYNMOUS that zeros the queue anyway. Signed-off-by: Ram Amrani Signed-off-by: Ariel Elior --- providers/qedr/qelr_chain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/qedr/qelr_chain.c b/providers/qedr/qelr_chain.c index d9ccc0b..26d0d0a 100644 --- a/providers/qedr/qelr_chain.c +++ b/providers/qedr/qelr_chain.c @@ -87,7 +87,6 @@ int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size, /* init chain */ memset(chain, 0, sizeof(*chain)); - memset(chain->first_addr, 0, chain->size); chain->first_addr = addr; chain->size = a_chain_size; chain->p_cons_elem = chain->first_addr; @@ -97,6 +96,8 @@ int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size, chain->last_addr = (void *) ((uint8_t *)addr + (elem_size * (chain->n_elems -1))); + /* Note: since we are using MAP_ANONYMOUS the chain is zeroed for us */ + return 0; }