From patchwork Wed Oct 1 11:49:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 5011411 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A8D209F375 for ; Wed, 1 Oct 2014 11:56:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAF9820155 for ; Wed, 1 Oct 2014 11:56:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7D8C2014A for ; Wed, 1 Oct 2014 11:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751153AbaJAL4u (ORCPT ); Wed, 1 Oct 2014 07:56:50 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:51256 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146AbaJAL4t (ORCPT ); Wed, 1 Oct 2014 07:56:49 -0400 Received: from localhost.localdomain (unknown [37.163.159.60]) by smtp3-g21.free.fr (Postfix) with ESMTP id 0C24FA62E6; Wed, 1 Oct 2014 13:56:13 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.8/8.14.8) with ESMTP id s91Bshar013350; Wed, 1 Oct 2014 13:56:23 +0200 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.8/8.14.8/Submit) id s91Bp25p013041; Wed, 1 Oct 2014 13:51:02 +0200 From: Yann Droneaud To: Roland Dreier Cc: linux-rdma@vger.kernel.org, Dotan Barak , Yann Droneaud , Hadar Hen Zion , Or Gerlitz , Matan Barak Subject: [PATCH libibverbs 9/9] ibv_cmd_destroy_flow(): initialize comp_mask explicitly Date: Wed, 1 Oct 2014 13:49:39 +0200 Message-Id: X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 There's no need to clear the whole struct ibv_destroy_flow with memset(): only comp_mask field is not explicitly initialized in the function. This patch removes call to memset() and initialize comp_mask to 0. Link: http://marc.info/?i=cover.1412163687.git.ydroneaud@opteya.com Fixes: 389de6a6ef4e ('Add receive flow steering support') Cc: Hadar Hen Zion Cc: Or Gerlitz Cc: Matan Barak Signed-off-by: Yann Droneaud --- src/cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd.c b/src/cmd.c index 2f039f6852bb..d849e6dac214 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1384,8 +1384,8 @@ int ibv_cmd_destroy_flow(struct ibv_flow *flow_id) struct ibv_destroy_flow cmd; int ret = 0; - memset(&cmd, 0, sizeof(cmd)); IBV_INIT_CMD_EX(&cmd, sizeof(cmd), DESTROY_FLOW); + cmd.comp_mask = 0; cmd.flow_handle = flow_id->handle; if (write(flow_id->context->cmd_fd, &cmd, sizeof(cmd)) != sizeof(cmd))