dexter has uploaded this change for review.

View Change

cosmetic: fix static, typos and sourcecode formatting

This patch fixes a few minor cosmetic issues:
- Ensure that all function that can be declared as static are
declared as static
- Fix typos
- Fix sourcecode formatting

Related: SYS#8101
Change-Id: I3b3fa7dc6e2e541cccff6579b4424157e8233fa8
---
M src/ipa/libipa/es10b_euicc_mem_rst.c
M src/ipa/libipa/es10b_get_eim_cfg_data.c
M src/ipa/libipa/es10b_immediate_enable.c
M src/ipa/libipa/es10b_load_euicc_pkg.c
M src/ipa/libipa/es10b_retr_notif_from_lst.c
M src/ipa/libipa/es10c_get_prfle_info.c
M src/ipa/libipa/esipa_prvde_eim_pkg_rslt.c
M src/ipa/libipa/ipad.c
M src/ipa/libipa/proc_eim_pkg_retr.c
M src/ipa/libipa/proc_euicc_pkg_dwnld_exec.c
10 files changed, 59 insertions(+), 50 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/39/43439/1
diff --git a/src/ipa/libipa/es10b_euicc_mem_rst.c b/src/ipa/libipa/es10b_euicc_mem_rst.c
index 1e90adb..179f89a 100644
--- a/src/ipa/libipa/es10b_euicc_mem_rst.c
+++ b/src/ipa/libipa/es10b_euicc_mem_rst.c
@@ -131,7 +131,7 @@
return rc;
}

-int euicc_mem_rst(struct ipa_context *ctx, const struct ipa_es10b_euicc_mem_rst *req)
+static int euicc_mem_rst(struct ipa_context *ctx, const struct ipa_es10b_euicc_mem_rst *req)
{
struct ipa_buf *es10b_req = NULL;
struct ipa_buf *es10b_res = NULL;
@@ -180,7 +180,7 @@
return rc;
}

-int euicc_mem_rst_emu(struct ipa_context *ctx, const struct ipa_es10b_euicc_mem_rst *req)
+static int euicc_mem_rst_emu(struct ipa_context *ctx, const struct ipa_es10b_euicc_mem_rst *req)
{
struct ipa_buf *es10b_req = NULL;
struct ipa_buf *es10b_res = NULL;
diff --git a/src/ipa/libipa/es10b_get_eim_cfg_data.c b/src/ipa/libipa/es10b_get_eim_cfg_data.c
index 6e2f32b..9a34392 100644
--- a/src/ipa/libipa/es10b_get_eim_cfg_data.c
+++ b/src/ipa/libipa/es10b_get_eim_cfg_data.c
@@ -23,7 +23,7 @@
#include "es10x.h"
#include "es10b_get_eim_cfg_data.h"

-void convert_get_eim_cfg_data(struct ipa_es10b_eim_cfg_data *res)
+static void convert_get_eim_cfg_data(struct ipa_es10b_eim_cfg_data *res)
{
unsigned int i;
asn_enc_rval_t rc;
diff --git a/src/ipa/libipa/es10b_immediate_enable.c b/src/ipa/libipa/es10b_immediate_enable.c
index 922e015..9847fc0 100644
--- a/src/ipa/libipa/es10b_immediate_enable.c
+++ b/src/ipa/libipa/es10b_immediate_enable.c
@@ -57,7 +57,7 @@
return rc;
}

-int immediate_enable(struct ipa_context *ctx, bool refresh_flag)
+static int immediate_enable(struct ipa_context *ctx, bool refresh_flag)
{
struct ipa_buf *es10b_req = NULL;
struct ipa_buf *es10b_res = NULL;
@@ -87,7 +87,7 @@
return rc;
}

-int immediate_enable_emu(struct ipa_context *ctx, bool refresh_flag)
+static int immediate_enable_emu(struct ipa_context *ctx, bool refresh_flag)
{
struct ipa_es10c_enable_prfle_req enable_prfle_req = { 0 };
struct ipa_es10c_enable_prfle_res *enable_prfle_res = NULL;
diff --git a/src/ipa/libipa/es10b_load_euicc_pkg.c b/src/ipa/libipa/es10b_load_euicc_pkg.c
index 3bc0747..1989a59 100644
--- a/src/ipa/libipa/es10b_load_euicc_pkg.c
+++ b/src/ipa/libipa/es10b_load_euicc_pkg.c
@@ -71,7 +71,7 @@
return 0;
}

-struct ipa_es10b_load_euicc_pkg_res *load_euicc_pkg(struct ipa_context *ctx,
+static struct ipa_es10b_load_euicc_pkg_res *load_euicc_pkg(struct ipa_context *ctx,
const struct ipa_es10b_load_euicc_pkg_req *req)
{
struct ipa_buf *es10b_req = NULL;
@@ -105,7 +105,7 @@
return NULL;
}

-struct EuiccResultData *iot_emo_do_enable_psmo(struct ipa_context *ctx, const struct Psmo__enable *enable_psmo)
+static struct EuiccResultData *iot_emu_do_enable_psmo(struct ipa_context *ctx, const struct Psmo__enable *enable_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10c_enable_prfle_req enable_prfle_req = { 0 };
@@ -129,7 +129,8 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_disable_psmo(struct ipa_context *ctx, const struct Psmo__disable *disable_psmo)
+static struct EuiccResultData *iot_emu_do_disable_psmo(struct ipa_context *ctx,
+ const struct Psmo__disable *disable_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10c_disable_prfle_req disable_prfle_req = { 0 };
@@ -153,7 +154,7 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_delete_psmo(struct ipa_context *ctx, const struct Psmo__delete *delete_psmo)
+static struct EuiccResultData *iot_emu_do_delete_psmo(struct ipa_context *ctx, const struct Psmo__delete *delete_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10c_delete_prfle_req delete_prfle_req = { 0 };
@@ -175,8 +176,9 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_listProfileInfo_psmo(struct ipa_context *ctx,
- const struct ProfileInfoListRequest *listProfileInfo_psmo)
+static struct EuiccResultData *iot_emu_do_listProfileInfo_psmo(struct ipa_context *ctx,
+ const struct ProfileInfoListRequest
+ *listProfileInfo_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10c_get_prfle_info_req get_prfle_info_req = { 0 };
@@ -207,7 +209,7 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_getRAT_psmo(struct ipa_context *ctx, const struct Psmo__getRAT *getRAT_psmo)
+static struct EuiccResultData *iot_emu_do_getRAT_psmo(struct ipa_context *ctx, const struct Psmo__getRAT *getRAT_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10b_get_rat_res *get_rat_res = NULL;
@@ -234,8 +236,9 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_configureImmediateEnable_psmo(struct ipa_context *ctx, const struct Psmo__configureImmediateEnable
- *configureImmediateEnable_psmo)
+static struct EuiccResultData *iot_emu_do_configureImmediateEnable_psmo(struct ipa_context *ctx,
+ const struct Psmo__configureImmediateEnable
+ *configureImmediateEnable_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);

@@ -266,8 +269,9 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_setFallbackAttribute_psmo(struct ipa_context *ctx,
- const struct Psmo__setFallbackAttribute *setFallbackAttribute_psmo)
+static struct EuiccResultData *iot_emu_do_setFallbackAttribute_psmo(struct ipa_context *ctx,
+ const struct Psmo__setFallbackAttribute
+ *setFallbackAttribute_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);

@@ -280,8 +284,9 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_unsetFallbackAttribute_psmo(struct ipa_context *ctx,
- const struct Psmo__unsetFallbackAttribute *unsetFallbackAttribute_psmo)
+static struct EuiccResultData *iot_emu_do_unsetFallbackAttribute_psmo(struct ipa_context *ctx,
+ const struct Psmo__unsetFallbackAttribute
+ *unsetFallbackAttribute_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);

@@ -294,8 +299,9 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_setDefaultDpAddress_psmo(struct ipa_context *ctx,
- const SGP32_SetDefaultDpAddressRequest_t *setDefaultDpAddress_psmo)
+static struct EuiccResultData *iot_emu_do_setDefaultDpAddress_psmo(struct ipa_context *ctx,
+ const SGP32_SetDefaultDpAddressRequest_t
+ *setDefaultDpAddress_psmo)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
int rc;
@@ -313,7 +319,8 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_addEim_eco(struct ipa_context *ctx, const struct EimConfigurationData *addEim_eco)
+static struct EuiccResultData *iot_emu_do_addEim_eco(struct ipa_context *ctx,
+ const struct EimConfigurationData *addEim_eco)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10b_eim_cfg_data *eim_cfg_data = NULL;
@@ -389,7 +396,8 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_deleteEim_eco(struct ipa_context *ctx, const struct Eco__deleteEim *deleteEim_eco)
+static struct EuiccResultData *iot_emu_do_deleteEim_eco(struct ipa_context *ctx,
+ const struct Eco__deleteEim *deleteEim_eco)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10b_eim_cfg_data *eim_cfg_data = NULL;
@@ -448,8 +456,8 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_updateEim_eco(struct ipa_context *ctx,
- const struct EimConfigurationData *updateEim_eco)
+static struct EuiccResultData *iot_emu_do_updateEim_eco(struct ipa_context *ctx,
+ const struct EimConfigurationData *updateEim_eco)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10b_eim_cfg_data *eim_cfg_data = NULL;
@@ -538,7 +546,7 @@
return euicc_result_data;
}

-struct EuiccResultData *iot_emo_do_listEim_eco(struct ipa_context *ctx, const struct Eco__listEim *listEim_eco)
+static struct EuiccResultData *iot_emu_do_listEim_eco(struct ipa_context *ctx, const struct Eco__listEim *listEim_eco)
{
struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct EuiccResultData);
struct ipa_es10b_eim_cfg_data *eim_cfg_data = NULL;
@@ -584,8 +592,8 @@
return euicc_result_data;
}

-struct ipa_es10b_load_euicc_pkg_res *load_euicc_pkg_iot_emu(struct ipa_context *ctx,
- const struct ipa_es10b_load_euicc_pkg_req *req)
+static struct ipa_es10b_load_euicc_pkg_res *load_euicc_pkg_iot_emu(struct ipa_context *ctx,
+ const struct ipa_es10b_load_euicc_pkg_req *req)
{
struct ipa_es10b_load_euicc_pkg_res *res = NULL;
struct EuiccPackageResult *asn = NULL;
@@ -621,7 +629,7 @@
ipa_buf_assign(&euicc_sign_epr, euiccSignEPR_dummy, sizeof(euiccSignEPR_dummy));
IPA_COPY_IPA_BUF_TO_ASN(&asn->choice.euiccPackageResultSigned.euiccSignEPR, &euicc_sign_epr);

- /* Go through the list of PSMOs and ECOs and execute the corresponding iot_emo_do... functions */
+ /* Go through the list of PSMOs and ECOs and execute the corresponding iot_emu_do... functions */
switch (req->req.euiccPackageSigned.euiccPackage.present) {
case EuiccPackage_PR_psmoList:
for (i = 0; i < req->req.euiccPackageSigned.euiccPackage.choice.psmoList.list.count; i++) {
@@ -629,32 +637,32 @@
psmo_result = NULL;
switch (psmo->present) {
case Psmo_PR_enable:
- psmo_result = iot_emo_do_enable_psmo(ctx, &psmo->choice.enable);
+ psmo_result = iot_emu_do_enable_psmo(ctx, &psmo->choice.enable);
break;
case Psmo_PR_disable:
- psmo_result = iot_emo_do_disable_psmo(ctx, &psmo->choice.disable);
+ psmo_result = iot_emu_do_disable_psmo(ctx, &psmo->choice.disable);
break;
case Psmo_PR_delete:
- psmo_result = iot_emo_do_delete_psmo(ctx, &psmo->choice.Delete);
+ psmo_result = iot_emu_do_delete_psmo(ctx, &psmo->choice.Delete);
break;
case Psmo_PR_listProfileInfo:
- psmo_result = iot_emo_do_listProfileInfo_psmo(ctx, &psmo->choice.listProfileInfo);
+ psmo_result = iot_emu_do_listProfileInfo_psmo(ctx, &psmo->choice.listProfileInfo);
break;
case Psmo_PR_getRAT:
- psmo_result = iot_emo_do_getRAT_psmo(ctx, &psmo->choice.getRAT);
+ psmo_result = iot_emu_do_getRAT_psmo(ctx, &psmo->choice.getRAT);
break;
case Psmo_PR_configureImmediateEnable:
psmo_result =
- iot_emo_do_configureImmediateEnable_psmo(ctx, &psmo->choice.configureImmediateEnable);
+ iot_emu_do_configureImmediateEnable_psmo(ctx, &psmo->choice.configureImmediateEnable);
break;
case Psmo_PR_setFallbackAttribute:
- psmo_result = iot_emo_do_setFallbackAttribute_psmo(ctx, &psmo->choice.setFallbackAttribute);
+ psmo_result = iot_emu_do_setFallbackAttribute_psmo(ctx, &psmo->choice.setFallbackAttribute);
break;
case Psmo_PR_unsetFallbackAttribute:
- psmo_result = iot_emo_do_unsetFallbackAttribute_psmo(ctx, &psmo->choice.unsetFallbackAttribute);
+ psmo_result = iot_emu_do_unsetFallbackAttribute_psmo(ctx, &psmo->choice.unsetFallbackAttribute);
break;
case Psmo_PR_setDefaultDpAddress:
- psmo_result = iot_emo_do_setDefaultDpAddress_psmo(ctx, &psmo->choice.setDefaultDpAddress);
+ psmo_result = iot_emu_do_setDefaultDpAddress_psmo(ctx, &psmo->choice.setDefaultDpAddress);
break;
default:
IPA_LOGP_ES10X("LoadEuiccPackage", LERROR, "ignoring invalid or unsupported PSMO!\n");
@@ -671,16 +679,16 @@
eco_result = NULL;
switch (eco->present) {
case Eco_PR_addEim:
- eco_result = iot_emo_do_addEim_eco(ctx, &eco->choice.addEim);
+ eco_result = iot_emu_do_addEim_eco(ctx, &eco->choice.addEim);
break;
case Eco_PR_deleteEim:
- eco_result = iot_emo_do_deleteEim_eco(ctx, &eco->choice.deleteEim);
+ eco_result = iot_emu_do_deleteEim_eco(ctx, &eco->choice.deleteEim);
break;
case Eco_PR_updateEim:
- eco_result = iot_emo_do_updateEim_eco(ctx, &eco->choice.updateEim);
+ eco_result = iot_emu_do_updateEim_eco(ctx, &eco->choice.updateEim);
break;
case Eco_PR_listEim:
- eco_result = iot_emo_do_listEim_eco(ctx, &eco->choice.listEim);
+ eco_result = iot_emu_do_listEim_eco(ctx, &eco->choice.listEim);
break;
default:
IPA_LOGP_ES10X("LoadEuiccPackage", LERROR, "ignoring invalid or unsupported eCO!\n");
diff --git a/src/ipa/libipa/es10b_retr_notif_from_lst.c b/src/ipa/libipa/es10b_retr_notif_from_lst.c
index 608a8db..52773ca 100644
--- a/src/ipa/libipa/es10b_retr_notif_from_lst.c
+++ b/src/ipa/libipa/es10b_retr_notif_from_lst.c
@@ -24,8 +24,8 @@
#include "es10b_retr_notif_from_lst.h"

/* Convert a notificationList (RetrieveNotificationsListResponse) from RSP to SGP32 format. */
-void convert_notification_list(PendingNotificationList_t *lst_out,
- const struct RetrieveNotificationsListResponse__notificationList *lst_in)
+static void convert_notification_list(PendingNotificationList_t *lst_out,
+ const struct RetrieveNotificationsListResponse__notificationList *lst_in)
{
unsigned int i;
struct PendingNotification *pending_notif_item;
@@ -73,7 +73,7 @@
}

/*! Free a converted notificationList (RetrieveNotificationsListResponse). */
-void free_converted_notification_list(PendingNotificationList_t *lst)
+static void free_converted_notification_list(PendingNotificationList_t *lst)
{
int i;
if (!lst)
diff --git a/src/ipa/libipa/es10c_get_prfle_info.c b/src/ipa/libipa/es10c_get_prfle_info.c
index 9c82505..6005101 100644
--- a/src/ipa/libipa/es10c_get_prfle_info.c
+++ b/src/ipa/libipa/es10c_get_prfle_info.c
@@ -105,7 +105,7 @@
return sgp32_res;
}

-struct ipa_es10c_get_prfle_info_req *conv_get_prfle_info_req(const struct ipa_es10c_get_prfle_info_req *req)
+static struct ipa_es10c_get_prfle_info_req *conv_get_prfle_info_req(const struct ipa_es10c_get_prfle_info_req *req)
{
uint8_t default_tags[] = { 0x5A, 0x4F, 0x9F, 0x70, 0x91, 0x92, 0x95, 0x9F, 0x7B, 0x9F, 0x26, 0x9F, 0x67 };
struct ipa_es10c_get_prfle_info_req *conv_req = IPA_ALLOC_ZERO(struct ipa_es10c_get_prfle_info_req);
@@ -157,7 +157,7 @@
return conv_req;
}

-void conv_get_prfle_info_req_free(struct ipa_es10c_get_prfle_info_req *req)
+static void conv_get_prfle_info_req_free(struct ipa_es10c_get_prfle_info_req *req)
{
if (!req)
return;
diff --git a/src/ipa/libipa/esipa_prvde_eim_pkg_rslt.c b/src/ipa/libipa/esipa_prvde_eim_pkg_rslt.c
index 96af767..d0914b2 100644
--- a/src/ipa/libipa/esipa_prvde_eim_pkg_rslt.c
+++ b/src/ipa/libipa/esipa_prvde_eim_pkg_rslt.c
@@ -67,7 +67,7 @@
return enc;
}

-struct ipa_esipa_prvde_eim_pkg_rslt_res *dec_prvde_eim_pkg_rslt_res(const struct ipa_buf *msg_to_ipa_encoded)
+static struct ipa_esipa_prvde_eim_pkg_rslt_res *dec_prvde_eim_pkg_rslt_res(const struct ipa_buf *msg_to_ipa_encoded)
{
struct EsipaMessageFromEimToIpa *msg_to_ipa = NULL;
struct ipa_esipa_prvde_eim_pkg_rslt_res *res = NULL;
diff --git a/src/ipa/libipa/ipad.c b/src/ipa/libipa/ipad.c
index 0a590ec..98d31c5 100644
--- a/src/ipa/libipa/ipad.c
+++ b/src/ipa/libipa/ipad.c
@@ -88,7 +88,7 @@
return nvstate_bin;
}

-struct ipa_buf *nvstate_deserialize_ipa_buf(uint8_t ** nvstate_data, size_t *nvstate_data_len)
+static struct ipa_buf *nvstate_deserialize_ipa_buf(uint8_t ** nvstate_data, size_t *nvstate_data_len)
{
struct ipa_buf *buf;

diff --git a/src/ipa/libipa/proc_eim_pkg_retr.c b/src/ipa/libipa/proc_eim_pkg_retr.c
index ebe8e91..e5b3422 100644
--- a/src/ipa/libipa/proc_eim_pkg_retr.c
+++ b/src/ipa/libipa/proc_eim_pkg_retr.c
@@ -62,7 +62,7 @@
}

/* Relay package contents to suitable handler procedure */
-int eim_pkg_exec(struct ipa_context *ctx, const struct ipa_esipa_get_eim_pkg_res *get_eim_pkg_res)
+static int eim_pkg_exec(struct ipa_context *ctx, const struct ipa_esipa_get_eim_pkg_res *get_eim_pkg_res)
{
struct ipa_buf *allowed_ca_pkid = NULL;
bool indirect_profile_download = false;
diff --git a/src/ipa/libipa/proc_euicc_pkg_dwnld_exec.c b/src/ipa/libipa/proc_euicc_pkg_dwnld_exec.c
index f8f072b..d942bc7 100644
--- a/src/ipa/libipa/proc_euicc_pkg_dwnld_exec.c
+++ b/src/ipa/libipa/proc_euicc_pkg_dwnld_exec.c
@@ -159,7 +159,8 @@
* \param[inout] ctx pointer to ipa_context.
* \param[in] euicc_package_request pointer to struct that holds the EuiccPackageRequest.
* \returns struct with intermediate result on success, NULL on failure. */
-struct ipa_proc_eucc_pkg_dwnld_exec_res *ipa_proc_eucc_pkg_dwnld_exec(struct ipa_context *ctx, const struct EuiccPackageRequest
+struct ipa_proc_eucc_pkg_dwnld_exec_res *ipa_proc_eucc_pkg_dwnld_exec(struct ipa_context *ctx,
+ const struct EuiccPackageRequest
*euicc_package_request)
{
struct ipa_es10b_load_euicc_pkg_req load_euicc_pkg_req = { 0 };

To view, visit change 43439. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: onomondo-ipa
Gerrit-Branch: master
Gerrit-Change-Id: I3b3fa7dc6e2e541cccff6579b4424157e8233fa8
Gerrit-Change-Number: 43439
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>