aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Spiers <kyle@spiers.me>2018-03-08 20:28:43 -0500
committerJan Kara <jack@suse.cz>2018-03-09 07:04:20 -0500
commita9cee1764b6fa97f2b4cd0210b1a125fef2e7169 (patch)
tree9c3e1fd1e5048ea1598eca31ffe3f3dbeea6686c
parent785dffe1daf95c176504dea3069c9df11af7ff15 (diff)
reiserfs: Remove VLA from fs/reiserfs/reiserfs.h
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>
-rw-r--r--fs/reiserfs/reiserfs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h
index 48835a659948..ae4811fecc1f 100644
--- a/fs/reiserfs/reiserfs.h
+++ b/fs/reiserfs/reiserfs.h
@@ -1916,7 +1916,7 @@ struct reiserfs_de_head {
1916 1916
1917/* empty directory contains two entries "." and ".." and their headers */ 1917/* empty directory contains two entries "." and ".." and their headers */
1918#define EMPTY_DIR_SIZE \ 1918#define EMPTY_DIR_SIZE \
1919(DEH_SIZE * 2 + ROUND_UP (strlen (".")) + ROUND_UP (strlen (".."))) 1919(DEH_SIZE * 2 + ROUND_UP (sizeof(".") - 1) + ROUND_UP (sizeof("..") - 1))
1920 1920
1921/* old format directories have this size when empty */ 1921/* old format directories have this size when empty */
1922#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3) 1922#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)