From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 1A7E12BB5 for ; Thu, 25 Jan 2018 12:31:55 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id r78so14330239wme.0 for ; Thu, 25 Jan 2018 03:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xu6Yuw11RyKNFbk7p8nbOYXu/fIKvuWSctAAB9G7YJY=; b=xTkmYTzYneLzObgF4tBtuteIRXy9u0otL+R0f5zfo/Qa3ZjFDRLYAlLb2OE+uC8Eh4 wAH+7zGcQ+4SS7qOIox7dwO/weQ1G1TNrkBzkAwW13tmDeyrWK9nM9dfNuvnaVAF9zWO 9mlhrhBpSnbr1illnqs2gIjt6uYwVeouTz1rAvAErvNocX0nb6YBAI9nnAbWX9yTFlrc p4nZ+wgFv/rlxqNowgFOw7LUbGXLzmSMEaJ+x+fHmDvxP72kko5DoBSa6M93BsNL/1a5 5g2HiXOGVmKA07/SvI9heRCheZLgu41pHV5RujilyQ2Bh5gd0JW5PNLou/BeTjFZiSzy +JNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xu6Yuw11RyKNFbk7p8nbOYXu/fIKvuWSctAAB9G7YJY=; b=NlnHOrKV5laqVWh6NT1X9rm/dtpjCQVepx+yM443J+fMQknw4VR/qJ/7QyHuBBWEoF Xdue+l8uepUmoFwGMmUCt/dQufrlwvV/IXEKdhKVOEvOgMUpBkQVmafD/5jyFOWR2bUn RKXHGntJCyIBO5OJq6H8iP0krbZVz1ELxnbh97oVFJqgnR1T/eX4tdxsKFQwCRhU4leV 5ObvQ76VJzzkh+Y9oBbubAqqFtWG2QNlrNRqd/8pM4g5pTGtHIin24uqlZnLdPIkqrYX 0csGf9UiGOgqhMkgXLoiel1hyEBzs3cluwtU3hewkvU2KMF8WhOpc96DxF+Lu0I8ZXHf N7Ew== X-Gm-Message-State: AKwxytfl9TceYarvs6jqkgw5BKHNKRxCg8IG73iUNGs7dsS4fv/QfE2m zRRuf5JuNy3rws+JutxzzeCZkg== X-Google-Smtp-Source: AH8x227fJm+OOA3qT41Lj5xdlJjEqtaRCX9AmtTBs1Aqp6gZC4s7VPazOzVnB/3pt4ofbnIsNRKOGw== X-Received: by 10.28.182.5 with SMTP id g5mr7016030wmf.44.1516879914882; Thu, 25 Jan 2018 03:31:54 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 88sm1747955wro.79.2018.01.25.03.31.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 03:31:54 -0800 (PST) Date: Thu, 25 Jan 2018 12:31:41 +0100 From: Adrien Mazarguil To: Stephen Hemminger Cc: Shahaf Shuler , Nelio Laranjeiro , dev@dpdk.org, Marcelo Ricardo Leitner Message-ID: <20180125113141.GO4256@6wind.com> References: <20180124223625.1928-1-adrien.mazarguil@6wind.com> <20180124223625.1928-2-adrien.mazarguil@6wind.com> <20180124155857.52457b9d@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180124155857.52457b9d@xeon-e3> Subject: Re: [dpdk-dev] [PATCH v1 1/4] net/mlx4: move rdma-core calls to separate file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 11:31:55 -0000 On Wed, Jan 24, 2018 at 03:58:57PM -0800, Stephen Hemminger wrote: > On Thu, 25 Jan 2018 00:25:00 +0100 > Adrien Mazarguil wrote: > > > +const struct mlx4_glue *mlx4_glue = &(const struct mlx4_glue){ > > + .fork_init = mlx4_glue_fork_init, > > + .get_async_event = mlx4_glue_get_async_event, > > The cast should not be necessary here. It's not a mere cast but a compound literal. The mlx4_glue symbol represents a pointer to this structure, not the structure itself. This syntax is equivalent to: static const struct mlx4_glue mlx4_glue_internal = { ... }; const struct mlx4_glue *mlx4_glue = &mlx4_glue_internal; The reason I chose to expose a pointer instead of that structure directly is seamless transition to dlsym() in the next patch, otherwise all mlx4_glue->foo() need to be first written mlx4_glue.foo() and then modified as mlx4_glue->foo(). -- Adrien Mazarguil 6WIND