]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
reiserfs: Remove VLA from fs/reiserfs/reiserfs.h
authorKyle Spiers <kyle@spiers.me>
Fri, 9 Mar 2018 01:28:43 +0000 (17:28 -0800)
committerJan Kara <jack@suse.cz>
Fri, 9 Mar 2018 12:04:20 +0000 (13:04 +0100)
Remove Variable Length Array from fs/reiserfs/reiserfs.h. EMPTY_DIR_SIZE
is used as an array size and as it is using strlen() it need not be
evaluated at compile time. Change it's definition to use sizeof() to
force evaluation of array length at compile time.

Signed-off-by: Kyle Spiers <kyle@spiers.me>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/reiserfs/reiserfs.h

index 48835a659948f1367b1d2ad9cf71b3dc51a73ae0..ae4811fecc1fc793d531cbf6a709d8e89c9b2459 100644 (file)
@@ -1916,7 +1916,7 @@ struct reiserfs_de_head {
 
 /* empty directory contains two entries "." and ".." and their headers */
 #define EMPTY_DIR_SIZE \
-(DEH_SIZE * 2 + ROUND_UP (strlen (".")) + ROUND_UP (strlen ("..")))
+(DEH_SIZE * 2 + ROUND_UP (sizeof(".") - 1) + ROUND_UP (sizeof("..") - 1))
 
 /* old format directories have this size when empty */
 #define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)