]> Git Repo - J-linux.git/commitdiff
tee: optee: ffa: Fix missing-field-initializers warning
authorMark-PK Tsai <[email protected]>
Thu, 27 Jun 2024 06:59:09 +0000 (14:59 +0800)
committerJens Wiklander <[email protected]>
Thu, 27 Jun 2024 08:27:31 +0000 (10:27 +0200)
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 <[email protected]>
Signed-off-by: Mark-PK Tsai <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
drivers/tee/optee/ffa_abi.c

index ecb5eb079408efd7c75cd5b398f111efaa9e86b4..c5a3e25c55dab2cc3f07ec4211dc70c0f1944e24 100644 (file)
@@ -660,7 +660,9 @@ static bool optee_ffa_api_is_compatbile(struct ffa_device *ffa_dev,
                                        const struct ffa_ops *ops)
 {
        const struct ffa_msg_ops *msg_ops = ops->msg_ops;
                                        const struct ffa_ops *ops)
 {
        const struct ffa_msg_ops *msg_ops = ops->msg_ops;
-       struct ffa_send_direct_data data = { OPTEE_FFA_GET_API_VERSION };
+       struct ffa_send_direct_data data = {
+               .data0 = OPTEE_FFA_GET_API_VERSION,
+       };
        int rc;
 
        msg_ops->mode_32bit_set(ffa_dev);
        int rc;
 
        msg_ops->mode_32bit_set(ffa_dev);
@@ -677,7 +679,9 @@ static bool optee_ffa_api_is_compatbile(struct ffa_device *ffa_dev,
                return false;
        }
 
                return false;
        }
 
-       data = (struct ffa_send_direct_data){ OPTEE_FFA_GET_OS_VERSION };
+       data = (struct ffa_send_direct_data){
+               .data0 = OPTEE_FFA_GET_OS_VERSION,
+       };
        rc = msg_ops->sync_send_receive(ffa_dev, &data);
        if (rc) {
                pr_err("Unexpected error %d\n", rc);
        rc = msg_ops->sync_send_receive(ffa_dev, &data);
        if (rc) {
                pr_err("Unexpected error %d\n", rc);
@@ -698,7 +702,9 @@ static bool optee_ffa_exchange_caps(struct ffa_device *ffa_dev,
                                    unsigned int *rpc_param_count,
                                    unsigned int *max_notif_value)
 {
                                    unsigned int *rpc_param_count,
                                    unsigned int *max_notif_value)
 {
-       struct ffa_send_direct_data data = { OPTEE_FFA_EXCHANGE_CAPABILITIES };
+       struct ffa_send_direct_data data = {
+               .data0 = OPTEE_FFA_EXCHANGE_CAPABILITIES,
+       };
        int rc;
 
        rc = ops->msg_ops->sync_send_receive(ffa_dev, &data);
        int rc;
 
        rc = ops->msg_ops->sync_send_receive(ffa_dev, &data);
This page took 0.04533 seconds and 4 git commands to generate.