]> git.itanic.dy.fi Git - linux-stable/commitdiff
firmware: arm_ffa: Switch to using ffa_mem_desc_offset() accessor
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 5 Oct 2023 14:45:08 +0000 (15:45 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Sun, 8 Oct 2023 20:18:48 +0000 (21:18 +0100)
In preparation to add support to the new memory transaction descriptor,
the ep_mem_access member needs to be removed and hence even the macro
COMPOSITE_OFFSET(). Let us switch to using the new ffa_mem_desc_offset()
accessor in ffa_setup_and_transmit().

This will enable adding the support for new format transparently without
any changes here again.

Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-15-cddd3237809c@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_ffa/driver.c

index 49fcbeb63eaa5fdb3b78c5d7f6e944d018ad8613..c79067201487cad90c1cbce28056c3487c39e7c9 100644 (file)
@@ -454,8 +454,10 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize,
        mem_region->flags = args->flags;
        mem_region->sender_id = drv_info->vm_id;
        mem_region->attributes = ffa_memory_attributes_get(func_id);
-       ep_mem_access = buffer + COMPOSITE_OFFSET(0);
-       composite_offset = COMPOSITE_OFFSET(args->nattrs);
+       ep_mem_access = buffer +
+                       ffa_mem_desc_offset(buffer, 0, drv_info->version);
+       composite_offset = ffa_mem_desc_offset(buffer, args->nattrs,
+                                              drv_info->version);
 
        for (idx = 0; idx < args->nattrs; idx++, ep_mem_access++) {
                ep_mem_access->receiver = args->attrs[idx].receiver;