Skip to content

Commit a9cee17

Browse files
eiaisjankara
authored andcommitted
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 <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 785dffe commit a9cee17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/reiserfs/reiserfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ struct reiserfs_de_head {
19161916

19171917
/* empty directory contains two entries "." and ".." and their headers */
19181918
#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))
19201920

19211921
/* old format directories have this size when empty */
19221922
#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)

0 commit comments

Comments
 (0)