diff options
| author | Mohammed Javid <mjavid@codeaurora.org> | 2018-07-25 00:49:02 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-07-25 01:35:56 -0700 |
| commit | 35e9a55239f2fcace83e9873250bec3a4386cd19 (patch) | |
| tree | 40775e5ed2c2713d82b1ff0a5d09174e7ff9cffc | |
| parent | 6d910043a92ff1796832191703fba3417e9ab7f4 (diff) | |
ipacm: Fix IPACM -Wall -Werror issue
Done code change to fix -Wall -Werror issue.
Change-Id: I1deb0e1e85944ec1fc62249c4e700f4377dcf31f
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
| -rw-r--r-- | ipacm/inc/IPACM_Lan.h | 4 | ||||
| -rw-r--r-- | ipacm/inc/IPACM_Wan.h | 4 | ||||
| -rw-r--r-- | ipacm/src/IPACM_Lan.cpp | 28 | ||||
| -rw-r--r-- | ipacm/src/IPACM_OffloadManager.cpp | 6 | ||||
| -rw-r--r-- | ipacm/src/IPACM_Wan.cpp | 20 |
5 files changed, 33 insertions, 29 deletions
diff --git a/ipacm/inc/IPACM_Lan.h b/ipacm/inc/IPACM_Lan.h index 21a72c1..03219c5 100644 --- a/ipacm/inc/IPACM_Lan.h +++ b/ipacm/inc/IPACM_Lan.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -60,7 +60,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* ndc bandwidth ipatetherstats <ifaceIn> <ifaceOut> */ /* <in->out_bytes> <in->out_pkts> <out->in_bytes> <out->in_pkts */ -#define PIPE_STATS "%s %s %lu %lu %lu %lu" +#define PIPE_STATS "%s %s %llu %llu %llu %llu" #define IPA_PIPE_STATS_FILE_NAME "/data/misc/ipa/tether_stats" /* store each lan-iface unicast routing rule and its handler*/ diff --git a/ipacm/inc/IPACM_Wan.h b/ipacm/inc/IPACM_Wan.h index 870a322..b1f38cb 100644 --- a/ipacm/inc/IPACM_Wan.h +++ b/ipacm/inc/IPACM_Wan.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2013, The Linux Foundation. All rights reserved. +Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -60,7 +60,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define IPA_V2_NUM_DEFAULT_WAN_FILTER_RULE_IPV6 3 #endif -#define NETWORK_STATS "%s %lu %lu %lu %lu" +#define NETWORK_STATS "%s %llu %llu %llu %llu" #define IPA_NETWORK_STATS_FILE_NAME "/data/misc/ipa/network_stats" typedef struct _wan_client_rt_hdl diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp index 984e589..20def25 100644 --- a/ipacm/src/IPACM_Lan.cpp +++ b/ipacm/src/IPACM_Lan.cpp @@ -4344,7 +4344,7 @@ int IPACM_Lan::handle_tethering_stats_event(ipa_get_data_stats_resp_msg_v01 *dat num_dl_bytes += data->dl_dst_pipe_stats_list[pipe_len].num_ipv4_bytes; num_dl_bytes += data->dl_dst_pipe_stats_list[pipe_len].num_ipv6_bytes; IPACMDBG_H("Got matched dst-pipe (%d) from %d tx props\n", data->dl_dst_pipe_stats_list[pipe_len].pipe_index, cnt); - IPACMDBG_H("DL_packets:(%lu) DL_bytes:(%lu) \n", num_dl_packets, num_dl_bytes); + IPACMDBG_H("DL_packets:(%llu) DL_bytes:(%llu) \n", (long long)num_dl_packets, (long long)num_dl_bytes); break; } } @@ -4372,7 +4372,7 @@ int IPACM_Lan::handle_tethering_stats_event(ipa_get_data_stats_resp_msg_v01 *dat num_ul_bytes += data->ul_src_pipe_stats_list[pipe_len].num_ipv4_bytes; num_ul_bytes += data->ul_src_pipe_stats_list[pipe_len].num_ipv6_bytes; IPACMDBG_H("Got matched dst-pipe (%d) from %d tx props\n", data->ul_src_pipe_stats_list[pipe_len].pipe_index, cnt); - IPACMDBG_H("UL_packets:(%lu) UL_bytes:(%lu) \n", num_ul_packets, num_ul_bytes); + IPACMDBG_H("UL_packets:(%llu) UL_bytes:(%llu) \n", (long long)num_ul_packets, (long long)num_ul_bytes); break; } } @@ -4383,11 +4383,11 @@ int IPACM_Lan::handle_tethering_stats_event(ipa_get_data_stats_resp_msg_v01 *dat if (ul_pipe_found || dl_pipe_found) { - IPACMDBG_H("Update IPA_TETHERING_STATS_UPDATE_EVENT, TX(P%lu/B%lu) RX(P%lu/B%lu) DEV(%s) to LTE(%s) \n", - num_ul_packets, - num_ul_bytes, - num_dl_packets, - num_dl_bytes, + IPACMDBG_H("Update IPA_TETHERING_STATS_UPDATE_EVENT, TX(P%llu/B%llu) RX(P%llu/B%llu) DEV(%s) to LTE(%s) \n", + (long long)num_ul_packets, + (long long)num_ul_bytes, + (long long)num_dl_packets, + (long long)num_dl_bytes, dev_name, IPACM_Wan::wan_up_dev_name); fp = fopen(IPA_PIPE_STATS_FILE_NAME, "w"); @@ -4401,10 +4401,10 @@ int IPACM_Lan::handle_tethering_stats_event(ipa_get_data_stats_resp_msg_v01 *dat fprintf(fp, PIPE_STATS, dev_name, IPACM_Wan::wan_up_dev_name, - num_ul_bytes, - num_ul_packets, - num_dl_bytes, - num_dl_packets); + (long long)num_ul_bytes, + (long long)num_ul_packets, + (long long)num_dl_bytes, + (long long)num_dl_packets); fclose(fp); } return IPACM_SUCCESS; @@ -4795,6 +4795,11 @@ end: int IPACM_Lan::eth_bridge_add_flt_rule(uint8_t *mac, uint32_t rt_tbl_hdl, ipa_ip_type iptype, uint32_t *flt_rule_hdl) { int res = IPACM_SUCCESS; + + IPACMDBG_H("Received client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + IPACMDBG_H("Received rt_tbl_hdl :%d iptype %d\n", rt_tbl_hdl,iptype); + *flt_rule_hdl = 0; + #ifdef FEATURE_IPA_V3 int len; struct ipa_flt_rule_add flt_rule_entry; @@ -4806,7 +4811,6 @@ int IPACM_Lan::eth_bridge_add_flt_rule(uint8_t *mac, uint32_t rt_tbl_hdl, ipa_ip return IPACM_FAILURE; } - IPACMDBG_H("Received client MAC 0x%02x%02x%02x%02x%02x%02x.\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); len = sizeof(struct ipa_ioc_add_flt_rule_after) + sizeof(struct ipa_flt_rule_add); pFilteringTable = (struct ipa_ioc_add_flt_rule_after*)malloc(len); diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp index 81bf4e3..e5b8fae 100644 --- a/ipacm/src/IPACM_OffloadManager.cpp +++ b/ipacm/src/IPACM_OffloadManager.cpp @@ -135,7 +135,7 @@ RET IPACM_OffloadManager::provideFd(int fd, unsigned int groups) /* check socket name */ memset(&local, 0, sizeof(struct sockaddr_nl)); addr_len = sizeof(local); - getsockname(fd, (struct sockaddr *)&local, &addr_len); + getsockname(fd, (struct sockaddr *)&local, (socklen_t *)&addr_len); IPACMDBG_H(" FD %d, nl_pad %d nl_pid %u\n", fd, local.nl_pad, local.nl_pid); /* add the check if getting FDs already or not */ @@ -594,7 +594,7 @@ RET IPACM_OffloadManager::setQuota(const char * upstream_name /* upstream */, ui return FAIL_INPUT_CHECK; } - IPACMDBG_H("SET_DATA_QUOTA %s %lu", quota.interface_name, mb); + IPACMDBG_H("SET_DATA_QUOTA %s %llu", quota.interface_name, (long long)mb); rc = ioctl(fd, WAN_IOC_SET_DATA_QUOTA, "a); @@ -644,7 +644,7 @@ RET IPACM_OffloadManager::getStats(const char * upstream_name /* upstream */, offload_stats.tx = stats.tx_bytes; offload_stats.rx = stats.rx_bytes; - IPACMDBG_H("send getStats tx:%lu rx:%lu \n", offload_stats.tx, offload_stats.rx); + IPACMDBG_H("send getStats tx:%llu rx:%llu \n", (long long)offload_stats.tx, (long long)offload_stats.rx); close(fd); return SUCCESS; } diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp index f0fd119..32254c7 100644 --- a/ipacm/src/IPACM_Wan.cpp +++ b/ipacm/src/IPACM_Wan.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2013, 2017 The Linux Foundation. All rights reserved. +Copyright (c) 2013, 2018 The Linux Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -6229,12 +6229,12 @@ int IPACM_Wan::handle_network_stats_update(ipa_get_apn_data_stats_resp_msg_v01 * { if(data->apn_data_stats_list[apn_index].mux_id == ext_prop->ext[0].mux_id) { - IPACMDBG_H("Received IPA_TETHERING_STATS_UPDATE_NETWORK_STATS, MUX ID %d TX (P%lu/B%lu) RX (P%lu/B%lu)\n", + IPACMDBG_H("Received IPA_TETHERING_STATS_UPDATE_NETWORK_STATS, MUX ID %d TX (P%llu/B%llu) RX (P%llu/B%llu)\n", data->apn_data_stats_list[apn_index].mux_id, - data->apn_data_stats_list[apn_index].num_ul_packets, - data->apn_data_stats_list[apn_index].num_ul_bytes, - data->apn_data_stats_list[apn_index].num_dl_packets, - data->apn_data_stats_list[apn_index].num_dl_bytes); + (long long)data->apn_data_stats_list[apn_index].num_ul_packets, + (long long)data->apn_data_stats_list[apn_index].num_ul_bytes, + (long long)data->apn_data_stats_list[apn_index].num_dl_packets, + (long long)data->apn_data_stats_list[apn_index].num_dl_bytes); fp = fopen(IPA_NETWORK_STATS_FILE_NAME, "w"); if ( fp == NULL ) { @@ -6245,10 +6245,10 @@ int IPACM_Wan::handle_network_stats_update(ipa_get_apn_data_stats_resp_msg_v01 * fprintf(fp, NETWORK_STATS, dev_name, - data->apn_data_stats_list[apn_index].num_ul_packets, - data->apn_data_stats_list[apn_index].num_ul_bytes, - data->apn_data_stats_list[apn_index].num_dl_packets, - data->apn_data_stats_list[apn_index].num_dl_bytes); + (long long)data->apn_data_stats_list[apn_index].num_ul_packets, + (long long)data->apn_data_stats_list[apn_index].num_ul_bytes, + (long long)data->apn_data_stats_list[apn_index].num_dl_packets, + (long long)data->apn_data_stats_list[apn_index].num_dl_bytes); fclose(fp); break; }; |
