summaryrefslogtreecommitdiffstats
path: root/fs/udf/osta_udf.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2021-05-03 11:50:38 +0200
committerJan Kara <jack@suse.cz>2021-08-11 16:54:44 +0200
commitb3c8c9801eb9b8e0f73246b4b14efbde1a4c570c (patch)
tree99e571d7742eb89f6077736fcb12d452c0de7df3 /fs/udf/osta_udf.h
parent04e8ee504a677d07dd60f6c8aae912e4842301c8 (diff)
downloadlinux-stable-b3c8c9801eb9b8e0f73246b4b14efbde1a4c570c.tar.gz
linux-stable-b3c8c9801eb9b8e0f73246b4b14efbde1a4c570c.tar.bz2
linux-stable-b3c8c9801eb9b8e0f73246b4b14efbde1a4c570c.zip
udf: Get rid of 0-length arrays
Declare variable length arrays using [] instead of the old-style declarations using arrays with 0 members. Also comment out entries in structures beyond the first variable length array (we still do keep them in comments as a reminder there are further entries in the structure behind the variable length array). Accessing such entries needs a careful offset math anyway so it is safer to not have them declared. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/osta_udf.h')
-rw-r--r--fs/udf/osta_udf.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/udf/osta_udf.h b/fs/udf/osta_udf.h
index 1c83aeede52e..157de0ec0cd5 100644
--- a/fs/udf/osta_udf.h
+++ b/fs/udf/osta_udf.h
@@ -111,7 +111,7 @@ struct logicalVolIntegrityDescImpUse {
__le16 minUDFReadRev;
__le16 minUDFWriteRev;
__le16 maxUDFWriteRev;
- uint8_t impUse[0];
+ uint8_t impUse[];
} __packed;
/* Implementation Use Volume Descriptor (UDF 2.60 2.2.7) */
@@ -190,8 +190,8 @@ struct virtualAllocationTable20 {
__le16 minUDFWriteRev;
__le16 maxUDFWriteRev;
__le16 reserved;
- uint8_t impUse[0];
- __le32 vatEntry[0];
+ uint8_t impUse[];
+ /* __le32 vatEntry[]; */
} __packed;
#define ICBTAG_FILE_TYPE_VAT20 0xF8U
@@ -208,8 +208,7 @@ struct sparingTable {
__le16 reallocationTableLen;
__le16 reserved;
__le32 sequenceNum;
- struct sparingEntry
- mapEntry[0];
+ struct sparingEntry mapEntry[];
} __packed;
/* Metadata File (and Metadata Mirror File) (UDF 2.60 2.2.13.1) */
@@ -232,7 +231,7 @@ struct allocDescImpUse {
/* FreeEASpace (UDF 2.60 3.3.4.5.1.1) */
struct freeEaSpace {
__le16 headerChecksum;
- uint8_t freeEASpace[0];
+ uint8_t freeEASpace[];
} __packed;
/* DVD Copyright Management Information (UDF 2.60 3.3.4.5.1.2) */
@@ -256,7 +255,7 @@ struct LVExtensionEA {
/* FreeAppEASpace (UDF 2.60 3.3.4.6.1) */
struct freeAppEASpace {
__le16 headerChecksum;
- uint8_t freeEASpace[0];
+ uint8_t freeEASpace[];
} __packed;
/* UDF Defined System Stream (UDF 2.60 3.3.7) */