From 4fb371246219e7f2b068a073e0f28878c20c45f1 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 6 Oct 2022 17:18:48 -0700 Subject: [PATCH] Modify the mmc data structure. The new 6.0 kernel headers changed all variable length structures from [0] to []. This causes a clang warning to trigger, so rewrite the mmc data structures using a union to avoid having a variable sized array in the middle of the structure. Test: Builds. Change-Id: Ib1ac92c4f76af386d934f51a3c73cb8914e97624 --- trusty/storage/proxy/rpmb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trusty/storage/proxy/rpmb.c b/trusty/storage/proxy/rpmb.c index f059935bf..b1b823269 100644 --- a/trusty/storage/proxy/rpmb.c +++ b/trusty/storage/proxy/rpmb.c @@ -322,9 +322,9 @@ static enum scsi_result check_sg_io_hdr(const sg_io_hdr_t* io_hdrp) { } static int send_mmc_rpmb_req(int mmc_fd, const struct storage_rpmb_send_req* req) { - struct { + union { struct mmc_ioc_multi_cmd multi; - struct mmc_ioc_cmd cmd_buf[3]; + uint8_t raw[sizeof(struct mmc_ioc_multi_cmd) + sizeof(struct mmc_ioc_cmd) * 3]; } mmc = {}; struct mmc_ioc_cmd* cmd = mmc.multi.cmds; int rc;