Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9361677ybi; Wed, 10 Jul 2019 09:00:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEP/ntLWCs9z5I/+xC4AYTxMJNPIo1ZmnXn+RCM3TLPJlbeAp66bxIv5O/qNF3lvcl52J4 X-Received: by 2002:a65:42c6:: with SMTP id l6mr39768211pgp.442.1562774433599; Wed, 10 Jul 2019 09:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562774433; cv=none; d=google.com; s=arc-20160816; b=Pbcu+ufxQPC867+ClhUd+jv3UROkHjlIYAa+h4Iiaudw+Htv/Kuck94ULMNLO4rFFU OS2hb8HZgxbSBaAAWE0wsBQj5HzaiM1edLowASl4aqmZcxu2O1NsWKnf4wt5MnC3cn5I P8ZeN1Adt6aeCzAvFG2GJYkRHJGOyl682FopYmNdHC9LRFojx0xyDEAhjWvXYPR0vrhU YAlBiWRgEopfTLagzMZ2sYIU9qb6PZiuyxO9fiPgr1/Ro0iLrfFO445YkY1MHe5BiIPk QR35x8Ae8LVSfZEF/O+fpJFue28rWbCZR7xgEiK1YE0YCGnvkK+QOPYhSQxfuMEBS1P/ H2ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from; bh=/vM8msjwSlvIEyTRiwDQfRgAzS6J7kPlKmd7yIETF8M=; b=vB0/CvSNqr6M5zcTzIiKa+JuKRXIDO/n/59O3nDkN+Ialkbck63j2/BQ6tTMdJzABx IGjeO8cfstJlaZ3umqkzjgAFT1TszBRyVYsdArFBPMPL1ISvXkoHxZT17l7afGLXtqM1 rjX3VwZDTAPgUPVMC+m0vr1AHcMxRG4RhW1ASLUA9rsww3CweJ//URLTm0HvQJ1uE2Mg Gdym8ls57W6xOtyU4ps906t55s/p9zduwJu8R24B/ZivT+9LwoLd6TNfDY8GqAd/ugnf p/Bst/5LBpBPb0+k/pummR/nxZg8UJLWNX6FHduAtNxINNB1/2cJI87/vnl2xa+HVp5U 0O0w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k137si2486796pga.59.2019.07.10.09.00.01; Wed, 10 Jul 2019 09:00:33 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728322AbfGJP6V (ORCPT + 99 others); Wed, 10 Jul 2019 11:58:21 -0400 Received: from mga03.intel.com ([134.134.136.65]:20541 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbfGJP6U (ORCPT ); Wed, 10 Jul 2019 11:58:20 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 08:58:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,475,1557212400"; d="p7s'?scan'208";a="176881156" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga002.jf.intel.com with ESMTP; 10 Jul 2019 08:58:19 -0700 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 08:58:19 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.44]) by ORSMSX112.amr.corp.intel.com ([169.254.3.118]) with mapi id 14.03.0439.000; Wed, 10 Jul 2019 08:58:18 -0700 From: "Stotland, Inga" To: "michal.lowas-rzechonek@silvair.com" , "jakub.witowski@silvair.com" , "linux-bluetooth@vger.kernel.org" , "Gix, Brian" Subject: Re: [PATCH BlueZ 4/9] mesh: Generalize mesh-config APIs Thread-Topic: [PATCH BlueZ 4/9] mesh: Generalize mesh-config APIs Thread-Index: AQHVNt2/MW9GDe22gkC1tEIiumBj16bD7ImAgAB7wYCAAA/mgA== Date: Wed, 10 Jul 2019 15:58:18 +0000 Message-ID: <777f20a73b67ad91d1234c0674df6ff4ae95024c.camel@intel.com> References: <20190710050959.7321-1-inga.stotland@intel.com> <20190710050959.7321-5-inga.stotland@intel.com> <20190710073827.5ktzlyynztmebiv6@mlowasrzechonek2133> <20190710150123.veutvrmbhx5v7phg@kynes> In-Reply-To: <20190710150123.veutvrmbhx5v7phg@kynes> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.254.108.59] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-aNRxZWsBdAY+LzaBRXl8" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-aNRxZWsBdAY+LzaBRXl8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michal, On Wed, 2019-07-10 at 17:01 +0200, Micha=C5=82 Lowas-Rzechonek wrote: > On 07/10, Micha=C5=82 Lowas-Rzechonek wrote: > > mesh-config.h: > > union mesh_config; > >=20 > > union mesh_config *mesh_config_create_config(void); > > void mesh_config_release_config(union mesh_config *config); > >=20 > > mesh-config-json.c: > > union mesh_config { > > json_object *json > > }; > >=20 > > union mesh_config *mesh_config_create_config(void) > > { > > return (union mesh_config*)json_object_new_object(); > > } > >=20 > > void mesh_config_release_config(union mesh_config *cfg) > > { > > json_object *jnode =3D (json_object *)cfg; > >=20 > > if (!cfg) > > return; > >=20 > > json_object_put(jnode); > > } >=20 > Or even simpler, since we don't even need to define the mesh_config: >=20 > mesh-config.h > struct mesh_config; >=20 > struct mesh_config *mesh_config_create_config(void); > void mesh_config_release_config(struct mesh_config *config); >=20 > struct mesh_config *mesh_config_create_config(void) > { > return (struct mesh_config*)json_object_new_object(); > } >=20 > void mesh_config_release_config(struct mesh_config *cfg) > { > json_object *jnode =3D (json_object *)cfg; > } >=20 I agree. Defining structure forward is better. Inga --=-aNRxZWsBdAY+LzaBRXl8 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbDCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0 d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDAeFw0xMzEyMTEwMDAwMDBa Fw0yMDA1MzAxMDQ4MzhaMHkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEUMBIGA1UEBxMLU2Fu dGEgQ2xhcmExGjAYBgNVBAoTEUludGVsIENvcnBvcmF0aW9uMSswKQYDVQQDEyJJbnRlbCBFeHRl cm5hbCBCYXNpYyBJc3N1aW5nIENBIDRCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMI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