Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3934098ybi; Tue, 18 Jun 2019 08:50:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIJw0wmAS8KuAJ64/leI2FDyqEzYrUIv+vCq4ASwW9ZCv+9ONjX27GQO3znnu+aydoyN82 X-Received: by 2002:a63:e608:: with SMTP id g8mr3343896pgh.382.1560873032346; Tue, 18 Jun 2019 08:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560873032; cv=none; d=google.com; s=arc-20160816; b=t3GctvWA0QC+VXGMScyKsJ0TLrR8hAX1HChEC3dKEyeptoPiJDdbwUaYsTIadJVBFb cjH7KqQeMIfFeKgp+X7yNd8Nb6PWNqxvg//K6Q4NIpcLIXQBTMJd1kW6saBnN7yShGro IQ161qY0/LW2W6c1eTHP3HRKVcvxxfSsq8wXqLVcH64UeBEK+k9bv5EDICuxshUJ07cP M/2fILX5bP9bQYfoVxAzkz2/afM5KhPxg7GucX6/Ms730NeXmC4RktQG8aXZaLy4Rmxl ILC2bnaNMmo4qvTQAuaVDUy+UtCSKsXT6MZ9QK5OdQnoWtSSt4opgVYbFwr44L3+agYP lHgA== 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:cc:to:from; bh=q+M9d+Sv5u8rwS7zKgZN/N+vNQLDortySdZwmingt7E=; b=SSJWPwaNbOvmfqCnEVyiDpeONkanz1bQ7ZA85KIU1eCHrecXcNQZDofvpn54/Qp0mZ J8psODvbBgahG9AseCoXxVbM/DOj1/zJld5H5jqLg/q7Yb9vESoiaJIguT2LGXmHvKDB d0kmRc0/n8yOIMQF4sEtQF7BQ0SAvuP1607UTNK/1/Ej+1D1onBzoQp6dgB5dq35pwo/ ctbxOifZMPniJ39QVpOP2PgN1d/ECCnW16EmrQTTyXxmXzkcSH8XyskM82lKmT58gXO4 5IXVJX4kfdpzwxJ40jl9Z4o/XnTtQhHDBnRZzpfGVfUXh5o9PhKxhZEAa0lR/sCi4IYh /ojg== 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 i32si2530159pje.44.2019.06.18.08.49.56; Tue, 18 Jun 2019 08:50:32 -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 S1729455AbfFRPtv (ORCPT + 99 others); Tue, 18 Jun 2019 11:49:51 -0400 Received: from mga07.intel.com ([134.134.136.100]:28849 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729414AbfFRPtv (ORCPT ); Tue, 18 Jun 2019 11:49:51 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 08:49:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,389,1557212400"; d="p7s'?scan'208";a="170263491" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by orsmga002.jf.intel.com with ESMTP; 18 Jun 2019 08:49:50 -0700 Received: from orsmsx121.amr.corp.intel.com (10.22.225.226) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 08:49:50 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.135]) by ORSMSX121.amr.corp.intel.com ([169.254.10.250]) with mapi id 14.03.0439.000; Tue, 18 Jun 2019 08:49:50 -0700 From: "Stotland, Inga" To: "michal.lowas-rzechonek@silvair.com" CC: "linux-bluetooth@vger.kernel.org" , "Gix, Brian" Subject: Re: [PATCH BlueZ] mesh: Clean up includes Thread-Topic: [PATCH BlueZ] mesh: Clean up includes Thread-Index: AQHVJVUZfzUwJDVn802Jjyb6kK5cYqahe6CAgACJ+AA= Date: Tue, 18 Jun 2019 15:49:49 +0000 Message-ID: <6b160fc3a67b72495bd533a884ae7edd2d39c47b.camel@intel.com> References: <20190617213847.21705-1-inga.stotland@intel.com> <20190618073559.tmpaj2oellkf5354@mlowasrzechonek2133> In-Reply-To: <20190618073559.tmpaj2oellkf5354@mlowasrzechonek2133> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.252.137.5] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-w7iVM/j2rtAPzrBkt7YX" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-w7iVM/j2rtAPzrBkt7YX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michal, On Tue, 2019-06-18 at 09:35 +0200, Micha=C5=82 Lowas-Rzechonek wrote: > Hi Inga, >=20 > On 06/17, Inga Stotland wrote: > > This adds #include for json-c/json.h in mesh-db.h and removes this > > include from the other files that don't need to reference json-c. >=20 > While I agree about removal from cfgmod-server, model and node, I > don't > think we should remove the include from storage and move it to mesh- > db. >=20 > I'd rather see #includes follow https://include-what-you-use.org/ > approach, that is: >=20 > (...) for every symbol (type, function variable, or macro) that > you > use in foo.cc, either foo.cc or foo.h should #include a .h file > that > exports the declaration of that symbol. >=20 > Moreover, I think headers should only be included as-needed (mostly > in > .c files), and headers should contain forward declarations of various > types, to make them opaque. >=20 > Such an approach cuts implicit dependencies, making code maintenance > easier: when, for example, someone decides to refactor mesh-db not to > use json_object anymore, they shouldn't need to suddenly deal with > missing declarations in other modules (in this case, storage). >=20 > Moreover, each header should be self-sufficient: in order to use API > exposed by a given header, it should be enough to include that header > only. At the moment, this is not the case. >=20 > A minor side-effect would be faster builds and less rebuilds when > code > is being worked on. >=20 > If you agree, I am more than happy to fix this throughout the mesh/ > codebase. >=20 I don't disagree, this was sort of an "intermediate" patch. I'd prefer to remove the reference to json from storage.c and the rest of the code and localize it in only one file that would deal with json-related processing. So I might just as well go ahead and make mesh-db.h a generic API to allow for different storage formats (even though for now we have only json defined format). Best regards, Inga --=-w7iVM/j2rtAPzrBkt7YX 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 cm5hbCBCYXNpYyBJc3N1aW5nIENBIDRCMIIBIjANBgk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