From 979a6e28dd969a2222545001f79566b4bfaf06c0 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 3 May 2021 11:54:24 +0200 Subject: udf: Get rid of 0-length arrays in struct fileIdentDesc Get rid of 0-length arrays in struct fileIdentDesc. This requires a bit of cleaning up as the second variable length array in this structure is often used and the code abuses the fact that the first two arrays have the same type and offset in struct fileIdentDesc. Signed-off-by: Jan Kara --- fs/udf/udfdecl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/udf/udfdecl.h') diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index 9dd0814f1077..7e258f15b8ef 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h @@ -130,6 +130,10 @@ static inline unsigned int udf_dir_entry_len(struct fileIdentDesc *cfi) le16_to_cpu(cfi->lengthOfImpUse) + cfi->lengthFileIdent, UDF_NAME_PAD); } +static inline uint8_t *udf_get_fi_ident(struct fileIdentDesc *fi) +{ + return ((uint8_t *)(fi + 1)) + le16_to_cpu(fi->lengthOfImpUse); +} /* file.c */ extern long udf_ioctl(struct file *, unsigned int, unsigned long); -- cgit v1.2.3