Re: [PATCH BlueZ 5/9] mesh: Change variable prefix "jconfig" to "config"

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

 



Inga,

On 07/09, Inga Stotland wrote:
> This adjust variable naming by changing "jconfig" prefix to more generic
> "config. This also removes #include json-c/json.h for model.c,
> cfg-server.c and node.c as they no longer rely on the specifics of node
> configuration storage implementation.
> ---
>  mesh/cfgmod-server.c | 16 +++++++---------
>  mesh/model.c         |  1 -
>  mesh/node.c          | 25 ++++++++++++-------------
>  mesh/node.h          |  4 ++--
>  mesh/storage.c       | 34 +++++++++++++++++-----------------
>  5 files changed, 38 insertions(+), 42 deletions(-)
> 
> diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c
> index 0479a9185..1aa7c85da 100644
> --- a/mesh/cfgmod-server.c
> +++ b/mesh/cfgmod-server.c
> @@ -24,8 +24,6 @@
>  #include <sys/time.h>
>  #include <ell/ell.h>
>  
> -#include "json-c/json.h"
> -
>  #include "mesh/mesh-defs.h"
>  #include "mesh/node.h"
>  #include "mesh/net.h"
> @@ -197,7 +195,7 @@ static bool config_pub_set(struct mesh_node *node, uint16_t src, uint16_t dst,
>  
>  		/* Remove model publication from config file */
>  		if (status == MESH_STATUS_SUCCESS)
> -			mesh_config_model_pub_del(node_jconfig_get(node),
> +			mesh_config_model_pub_del(node_config_get(node),
>  				ele_addr, vendor ? mod_id : mod_id & 0x0000ffff,
>  									vendor);
>  		goto done;
> @@ -219,7 +217,7 @@ static bool config_pub_set(struct mesh_node *node, uint16_t src, uint16_t dst,
>  			memcpy(db_pub.virt_addr, pub_addr, 16);
>  
>  		/* Save model publication to config file */
> -		if (!mesh_config_model_pub_add(node_jconfig_get(node), ele_addr,
> +		if (!mesh_config_model_pub_add(node_config_get(node), ele_addr,
>  					vendor ? mod_id : mod_id & 0x0000ffff,
>  					vendor, &db_pub))
>  			status = MESH_STATUS_STORAGE_FAIL;
> @@ -331,18 +329,18 @@ static bool save_config_sub(struct mesh_node *node, uint16_t ele_addr,
>  
>  	if (opcode == OP_CONFIG_MODEL_SUB_VIRT_OVERWRITE ||
>  					opcode == OP_CONFIG_MODEL_SUB_OVERWRITE)
> -		mesh_config_model_sub_del_all(node_jconfig_get(node),
> +		mesh_config_model_sub_del_all(node_config_get(node),
>  				ele_addr, vendor ? mod_id : mod_id & 0x0000ffff,
>  									vendor);
>  
>  	if (opcode != OP_CONFIG_MODEL_SUB_VIRT_DELETE &&
>  			opcode != OP_CONFIG_MODEL_SUB_DELETE)
> -		return mesh_config_model_sub_add(node_jconfig_get(node),
> +		return mesh_config_model_sub_add(node_config_get(node),
>  					ele_addr,
>  					vendor ? mod_id : mod_id & 0x0000ffff,
>  					vendor, &db_sub);
>  	else
> -		return mesh_config_model_sub_del(node_jconfig_get(node),
> +		return mesh_config_model_sub_del(node_config_get(node),
>  					ele_addr,
>  					vendor ? mod_id : mod_id & 0x0000ffff,
>  					vendor, &db_sub);
> @@ -419,7 +417,7 @@ static void config_sub_set(struct mesh_node *node, uint16_t src, uint16_t dst,
>  		status = mesh_model_sub_del_all(node, ele_addr, mod_id);
>  
>  		if (status == MESH_STATUS_SUCCESS)
> -			mesh_config_model_sub_del_all(node_jconfig_get(node),
> +			mesh_config_model_sub_del_all(node_config_get(node),
>  				ele_addr, vendor ? mod_id : mod_id & 0x0000ffff,
>  									vendor);
>  		break;
> @@ -878,7 +876,7 @@ static bool cfg_srv_pkt(uint16_t src, uint32_t dst,
>  
>  		count = (pkt[0] >> 5) + 1;
>  		interval = ((pkt[0] & 0x1f) + 1) * 10;
> -		if (storage_set_transmit_params(node_jconfig_get(node), count,
> +		if (storage_set_transmit_params(node_config_get(node), count,
>  								interval))

Given the signature:

bool storage_set_transmit_params(struct mesh_node *node, uint8_t count,
                                                            uint8_t interval)

shouldn't that be:

    if (storage_set_transmit_params(node, count, interval))

and in other places as well?

-- 
Michał Lowas-Rzechonek <michal.lowas-rzechonek@xxxxxxxxxxx>
Silvair http://silvair.com
Jasnogórska 44, 31-358 Krakow, POLAND



[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