Skip to content

Commit e055625

Browse files
PeikanTsaijenswi-linaro
authored andcommitted
tee: optee: ffa: Fix missing-field-initializers warning
The 'missing-field-initializers' warning was reported when building with W=2. This patch use designated initializers for 'struct ffa_send_direct_data' to suppress the warning and clarify the initialization intent. Signed-off-by: ming-jen.chang <ming-jen.chang@mediatek.com> Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
1 parent a38297e commit e055625

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

drivers/tee/optee/ffa_abi.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,9 @@ static bool optee_ffa_api_is_compatbile(struct ffa_device *ffa_dev,
660660
const struct ffa_ops *ops)
661661
{
662662
const struct ffa_msg_ops *msg_ops = ops->msg_ops;
663-
struct ffa_send_direct_data data = { OPTEE_FFA_GET_API_VERSION };
663+
struct ffa_send_direct_data data = {
664+
.data0 = OPTEE_FFA_GET_API_VERSION,
665+
};
664666
int rc;
665667

666668
msg_ops->mode_32bit_set(ffa_dev);
@@ -677,7 +679,9 @@ static bool optee_ffa_api_is_compatbile(struct ffa_device *ffa_dev,
677679
return false;
678680
}
679681

680-
data = (struct ffa_send_direct_data){ OPTEE_FFA_GET_OS_VERSION };
682+
data = (struct ffa_send_direct_data){
683+
.data0 = OPTEE_FFA_GET_OS_VERSION,
684+
};
681685
rc = msg_ops->sync_send_receive(ffa_dev, &data);
682686
if (rc) {
683687
pr_err("Unexpected error %d\n", rc);
@@ -698,7 +702,9 @@ static bool optee_ffa_exchange_caps(struct ffa_device *ffa_dev,
698702
unsigned int *rpc_param_count,
699703
unsigned int *max_notif_value)
700704
{
701-
struct ffa_send_direct_data data = { OPTEE_FFA_EXCHANGE_CAPABILITIES };
705+
struct ffa_send_direct_data data = {
706+
.data0 = OPTEE_FFA_EXCHANGE_CAPABILITIES,
707+
};
702708
int rc;
703709

704710
rc = ops->msg_ops->sync_send_receive(ffa_dev, &data);

0 commit comments

Comments
 (0)