diff options
author | Denis Kenzior <denkenz@gmail.com> | 2024-04-22 16:19:43 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-04-22 17:26:13 -0500 |
commit | 231cde4f12a4e05dcb89a17893bee2655ab7cd7b (patch) | |
tree | 2ff16865f07c5b2f5e714babddda3f163c852e1f | |
parent | 3c5ed8ec1e571a98142e99c0c67dd8fca590d54f (diff) | |
download | ofono-231cde4f12a4e05dcb89a17893bee2655ab7cd7b.tar.gz |
qmi: voicecall: Remove ternary conditional use
Simplify the code a bit by removing the use of ternary conditional
operation and replace it with a 'remote_number_tlv' variable. This also
removed a slight coding violation where a mix of spaces and tabs was
used for indentation.
-rw-r--r-- | drivers/qmimodem/voicecall.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/qmimodem/voicecall.c b/drivers/qmimodem/voicecall.c index 5afa3a057..dcb91c642 100644 --- a/drivers/qmimodem/voicecall.c +++ b/drivers/qmimodem/voicecall.c @@ -263,7 +263,6 @@ static void all_call_status_ind(struct qmi_result *result, void *user_data) int i; int offset; uint16_t len; - bool status = true; int instance_size; const struct qmi_voice_call_information *call_information; const struct qmi_voice_remote_party_number *remote_party_number; @@ -275,6 +274,8 @@ static void all_call_status_ind(struct qmi_result *result, void *user_data) static const uint8_t RESULT_CALL_INFO_CALL_INFORMATION = 0x10; static const uint8_t RESULT_CALL_INFO_REMOTE_NUMBER = 0x11; + uint8_t remote_number_tlv = RESULT_CALL_STATUS_REMOTE_NUMBER; + DBG(""); /* mandatory */ @@ -285,7 +286,7 @@ static void all_call_status_ind(struct qmi_result *result, void *user_data) call_information = qmi_result_get( result, RESULT_CALL_INFO_CALL_INFORMATION, &len); - status = false; + remote_number_tlv = RESULT_CALL_INFO_REMOTE_NUMBER; } if (!call_information || len < sizeof(call_information->size)) { @@ -306,11 +307,7 @@ static void all_call_status_ind(struct qmi_result *result, void *user_data) } /* mandatory */ - remote_party_number = qmi_result_get( - result, - status ? RESULT_CALL_STATUS_REMOTE_NUMBER : - RESULT_CALL_INFO_REMOTE_NUMBER, - &len); + remote_party_number = qmi_result_get(result, remote_number_tlv, &len); if (!remote_party_number) { DBG("Unable to retrieve remote numbers"); |