From patchwork Wed Sep 12 16:04:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10597951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64C9F14BD for ; Wed, 12 Sep 2018 16:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 548FE2A5D2 for ; Wed, 12 Sep 2018 16:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 486262A674; Wed, 12 Sep 2018 16:04:41 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY 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 ED7FE2A669 for ; Wed, 12 Sep 2018 16:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbeILVJu (ORCPT ); Wed, 12 Sep 2018 17:09:50 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:41761 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726912AbeILVJt (ORCPT ); Wed, 12 Sep 2018 17:09:49 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 12 Sep 2018 19:08:48 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w8CG4XIK020180; Wed, 12 Sep 2018 19:04:33 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id w8CG4Xxf029563; Wed, 12 Sep 2018 19:04:33 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id w8CG4XwK029562; Wed, 12 Sep 2018 19:04:33 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, jgg@mellanox.com, markb@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 2/4] verbs: Expose a new accessor to be used with enum values Date: Wed, 12 Sep 2018 19:04:07 +0300 Message-Id: <1536768249-29432-3-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1536768249-29432-1-git-send-email-yishaih@mellanox.com> References: <1536768249-29432-1-git-send-email-yishaih@mellanox.com> 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 From: Mark Bloch When the kernel expects to get an enum const value, use fill_attr_const_in(). The enum value is passed as uint64 value. Signed-off-by: Mark Bloch Signed-off-by: Yishai Hadas --- libibverbs/cmd_ioctl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libibverbs/cmd_ioctl.h b/libibverbs/cmd_ioctl.h index 3a61f59..f856b74 100644 --- a/libibverbs/cmd_ioctl.h +++ b/libibverbs/cmd_ioctl.h @@ -296,6 +296,9 @@ fill_attr_in_uint64(struct ibv_command_buffer *cmd, uint16_t attr_id, return attr; } +#define fill_attr_const_in(cmd, attr_id, _data) \ + fill_attr_in_uint64(cmd, attr_id, _data) + static inline struct ib_uverbs_attr * fill_attr_in_uint32(struct ibv_command_buffer *cmd, uint16_t attr_id, uint32_t data)