Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9302383ybi; Wed, 10 Jul 2019 08:02:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqybzdsSJAiNnoziA2ICNQrgh0MpRjLSCs7IuJZZ1oWCGcKCXxZ18Y8WxDq8MunIeHPbcbbi X-Received: by 2002:a63:b10f:: with SMTP id r15mr29343400pgf.230.1562770956663; Wed, 10 Jul 2019 08:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562770956; cv=none; d=google.com; s=arc-20160816; b=j6ABWRqikwz+VQjLCbU3gM016p+YURSHav1vaDt6Ml3GZVmB05Pzfw18hN6zK4C/D/ vwyTaeZUHts/6Xa5sMpXJbw3P1rmz/qrVfmOxNNpE0GcNsdvzYAN2xa5iVFDoDgSWErV wLV19uwr3CysxmBSWeJtoxRxfy8i8tALDwxNQKWyoZfEYxZwRHnS+aC42MYYRhEQxU2B zuj9pG3f7gyXV9dVGXouU254hJMcnM5m+1gxXmRC1DYK3lpsI7oTkLVKuWyuwY7I+2dw CsX5n0a4nUKFzB66pRUdUYxAzvUifnoPYcXQVSQ19AZobqKbHwQ+Ivm4lDS8g9ZXtwiK ivzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:to:from:date :dkim-signature; bh=gyHdlxQUuHTKCDEz8RfXTpWvMUdjCx+KDbjik5V/FOU=; b=yOWIOSKsD8RHR+rcL52mB0ph4MPryYDXtNe2gCmxa479oWedzxIKD2UsqVC8U+8Mae 1WdZmAaALg67fp/lOdTEaBZzc0+eiB+7P4a3s1VZXCj5jvgq6xe1Dm2YT8xiXSDWGLwT ThAasVFhInO1hyftqcRU4245DwxGEb/KFT+8ifgQ6MHxmoBBbz1QWqc20JW7csoZBRD0 Bvg9xjEma1N1uIyT4KH5R0ZrK/RyyjOQ2E+dpZ/QXItcSS++6j42ive1ihHU+HCuJuyG 966MfCmKnbQ/T2+GTUjX2QhavhGX7CF/nvWiJh0NPytPtH8wQ82tLdsywSc8xhCbBhQZ WVAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b="M9W/6Mub"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si2331238pgt.460.2019.07.10.08.02.02; Wed, 10 Jul 2019 08:02:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b="M9W/6Mub"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbfGJPB3 (ORCPT + 99 others); Wed, 10 Jul 2019 11:01:29 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:33436 "EHLO mail-lj1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfGJPB3 (ORCPT ); Wed, 10 Jul 2019 11:01:29 -0400 Received: by mail-lj1-f182.google.com with SMTP id h10so2443157ljg.0 for ; Wed, 10 Jul 2019 08:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=gyHdlxQUuHTKCDEz8RfXTpWvMUdjCx+KDbjik5V/FOU=; b=M9W/6MubhCFx6bdbLbZYXe2mTlFO8JgO+N5dfw+RCosfJ6q4u8IkZ/rIzMGLkB0cnW /D7HkiB7zMSj4GnRmQhSkfE/8TN3rm4GffzFnwSwUpC51ydT9SaGr0JZP9crhfOU4YSr txHWdote5iUt9dAMQO+9dxdUgKBCsLDDW5H68wOVYRBL7oWYVQjQ+sPR85sy8Ime4Obm efqf9uHAjCKnBnGRaZxYHUzyWVLeo2VrIQMJESE1425kkwAUTWL125ahX+H59pWmIMYo baxyj5YDDCPVXmciHCqAI9xEwriIzyBQ2NkBTHXN8Vh/3Oyy11f5pRjxqUcLlmmmA7lQ tUzQ== 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:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=gyHdlxQUuHTKCDEz8RfXTpWvMUdjCx+KDbjik5V/FOU=; b=X7OSep/YHZIYiwS1NUprzqSaTiEeThVaFb7pJsmd3OWMI7eRJPM+nKY1tqB/5tfK9Z XyIuG8Cfu3sKDz2OBUcCahL7+ZQGHwTgZGAsZkWdOEo347o7FxLKQAJ1zgcOu7efwe4j Px9C1bSlte41VksfFTMeQ1ix6fVKFT0K9CD/tHp90RxSNZxkcHL4LT15Lwa3es0pv5NK GDjra6WP62zLV0CkPrOQwPZ85DdWr01z+T2JisbL3dPhsOoAj3+yhhAp12Toh2bl+LHS 3ac7WQQEeSAh+DH5w80eFoj/L++LriQNLdszrhiWdkEOxj6J7xcLTSkUPpBLcVvQ+hOR zjkQ== X-Gm-Message-State: APjAAAWbrGbmxh2odNieqaMrr/rioY4rxF5gODytimQ/NhEZhz3b4oOQ IKqHfI0A2KT2GGo+e+baGtmwWA== X-Received: by 2002:a2e:3008:: with SMTP id w8mr18342273ljw.13.1562770886793; Wed, 10 Jul 2019 08:01:26 -0700 (PDT) Received: from kynes (apn-77-112-37-101.dynamic.gprs.plus.pl. [77.112.37.101]) by smtp.gmail.com with ESMTPSA id o24sm506466ljg.6.2019.07.10.08.01.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2019 08:01:25 -0700 (PDT) Date: Wed, 10 Jul 2019 17:01:23 +0200 From: =?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek To: Inga Stotland , linux-bluetooth@vger.kernel.org, brian.gix@intel.com, jakub.witowski@silvair.com Subject: Re: [PATCH BlueZ 4/9] mesh: Generalize mesh-config APIs Message-ID: <20190710150123.veutvrmbhx5v7phg@kynes> Mail-Followup-To: Inga Stotland , linux-bluetooth@vger.kernel.org, brian.gix@intel.com, jakub.witowski@silvair.com References: <20190710050959.7321-1-inga.stotland@intel.com> <20190710050959.7321-5-inga.stotland@intel.com> <20190710073827.5ktzlyynztmebiv6@mlowasrzechonek2133> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190710073827.5ktzlyynztmebiv6@mlowasrzechonek2133> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 07/10, Michał Lowas-Rzechonek wrote: > mesh-config.h: > union mesh_config; > > union mesh_config *mesh_config_create_config(void); > void mesh_config_release_config(union mesh_config *config); > > mesh-config-json.c: > union mesh_config { > json_object *json > }; > > union mesh_config *mesh_config_create_config(void) > { > return (union mesh_config*)json_object_new_object(); > } > > void mesh_config_release_config(union mesh_config *cfg) > { > json_object *jnode = (json_object *)cfg; > > if (!cfg) > return; > > json_object_put(jnode); > } Or even simpler, since we don't even need to define the mesh_config: mesh-config.h struct mesh_config; struct mesh_config *mesh_config_create_config(void); void mesh_config_release_config(struct mesh_config *config); struct mesh_config *mesh_config_create_config(void) { return (struct mesh_config*)json_object_new_object(); } void mesh_config_release_config(struct mesh_config *cfg) { json_object *jnode = (json_object *)cfg; } -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND