Re: [PATCH] mesh: Add subscriptions to node structure and json database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Steve,

On Wed, Dec 20, 2017, sbrown@xxxxxxxxxxxx wrote:
>  mesh/config-client.c | 27 +++++++++++++++++-----
>  mesh/node.c          | 22 ++++++++++++++++++
>  mesh/node.h          |  2 ++
>  mesh/prov-db.c       | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  mesh/prov-db.h       |  2 ++
>  5 files changed, 110 insertions(+), 6 deletions(-)

Just a couple of coding style comments:

> +bool node_add_subscription(struct mesh_node *node, uint8_t ele_idx,
> +			uint32_t model_id, uint16_t addr)
> +{
> +	struct mesh_model *model;
> +	GList *l;
> +
> +	model = get_model(node, ele_idx, model_id);
> +
> +	if(!model)

Missing space after if, and remove the empty line before it (in general
no empty line between assigning to a variable and testing its value).

> +	l = g_list_find(model->subscriptions, GUINT_TO_POINTER(addr));
> +
> +	if (l)

Same thing here with the empty line

> +bool prov_db_add_subscription(struct mesh_node *node, uint8_t ele_idx,
> +			uint32_t model_id, uint16_t addr)
> +{
> +	json_object *jmain;
> +	json_object *jmodel;
> +	json_object *jsubscriptions = NULL;
> +	bool local = (node == node_get_local_node());

Rather minor, but the generally preferred aestethic with variable
declarations is "reverse xmas tree", i.e. longest ones first.

> +	jmodel = get_jmodel_obj(node, ele_idx, model_id, &jmain);
> +
> +	if (!jmodel)

Same thing as earlier with the empty line.

Otherwise looks fine to me.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux