qcdm: avoid upsetting the compiler with wrong aliasing

We shouldn't be accessiing u_int8_t * as u_int16_t *. Let's construct
the 16-bit value by or-ing the 8-bit halves directly; avoiding the
endianness conversion too.
This commit is contained in:
Lubomir Rintel
2016-07-20 19:53:00 +02:00
committed by Aleksander Morgado
parent 803caab80a
commit 488992b010

View File

@@ -2081,7 +2081,7 @@ qcdm_cmd_gsm_subsys_state_info_result (const char *buf, size_t len, int *out_err
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_LAI_MNC, mnc);
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_LAI_LAC,
le16toh (*(u_int16_t *)(&rsp->lai[3])));
rsp->lai[4] << 8 | rsp->lai[3]);
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CELLID, le16toh (rsp->cellid));
}