From patchwork Thu Jan 22 13:28:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 5684801 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4ADD5C058D for ; Thu, 22 Jan 2015 13:55:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AC472020F for ; Thu, 22 Jan 2015 13:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E81F202B8 for ; Thu, 22 Jan 2015 13:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628AbbAVNzi (ORCPT ); Thu, 22 Jan 2015 08:55:38 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:16014 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146AbbAVNzA (ORCPT ); Thu, 22 Jan 2015 08:55:00 -0500 Received: from localhost.localdomain (unknown [37.161.221.91]) by smtp3-g21.free.fr (Postfix) with ESMTP id 81F63A630B; Thu, 22 Jan 2015 14:52:33 +0100 (CET) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.9/8.14.8) with ESMTP id t0MDc4Tx010464; Thu, 22 Jan 2015 14:38:30 +0100 Received: (from ydroneaud@localhost) by localhost.localdomain (8.14.9/8.14.9/Submit) id t0MDat4U010444; Thu, 22 Jan 2015 14:36:55 +0100 From: Yann Droneaud To: Sagi Grimberg , Shachar Raindel , Eli Cohen , Haggai Eran Cc: Yann Droneaud , Roland Dreier , linux-rdma@vger.kernel.org Subject: [PATCH 4/4] IB/uverbs: ex_query_device: no need to clear the whole structure Date: Thu, 22 Jan 2015 14:28:05 +0100 Message-Id: <20d9ee35f60f24b9db5c58333a64b7d70e8c9018.1421931555.git.ydroneaud@opteya.com> X-Mailer: git-send-email 2.1.0 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 As only the requested fields are set and copied to userspace, there's no need to clear the content of the response structure beforehand. Link: http://mid.gmane.org/cover.1421931555.git.ydroneaud@opteya.com Cc: Sagi Grimberg Cc: Shachar Raindel Cc: Eli Cohen Cc: Haggai Eran Signed-off-by: Yann Droneaud --- drivers/infiniband/core/uverbs_cmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 80a1c90f1dbf..bedcd8499c9c 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -3331,9 +3331,9 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file, if (err) return err; - memset(&resp, 0, sizeof(resp)); copy_query_dev_fields(file, &resp.base, &attr); resp.comp_mask = 0; + resp.reserved = 0; #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING if (cmd.comp_mask & IB_USER_VERBS_EX_QUERY_DEVICE_ODP) { @@ -3349,6 +3349,9 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file, attr.odp_caps.per_transport_caps.uc_odp_caps; resp.odp_caps.per_transport_caps.ud_odp_caps = attr.odp_caps.per_transport_caps.ud_odp_caps; + + resp.odp_caps.reserved = 0; + resp.comp_mask |= IB_USER_VERBS_EX_QUERY_DEVICE_ODP; } #endif