Skip to contentSkip to conversation

Unnecessary #ifdef in commit c863114122ac

DISCUSSION Andreas Ruprecht 2 participants 2 messages May 21, 2015

lore
Share & tools
lore
#0 lore raw

Hi Jaegeuk,

your commit c863114122ac ("f2fs crypto: add symlink encryption") showed up in linux-next today (i.e., next-20150521). I noticed it because we run a daily analysis on linux-next, checking for inconsistencies regarding #ifdef blocks [0,1].

In the commit, you create nested #ifdef blocks like the following:

#ifdef CONFIG_F2FS_FS_ENCRYPTION
[...]
#ifdef CONFIG_F2FS_FS_XATTR
[...]
#endif
[...]
#endif

The inner #ifdef, however, is unnecessary as CONFIG_F2FS_FS_XATTR is defined with a dependency on CONFIG_F2FS_FS_ENCRYPTION (line 78 in the corresponding Kconfig file at fs/f2fs/Kconfig).

This means, CONFIG_F2FS_FS_XATTR can never be disabled if CONFIG_F2FS_FS_ENCRYPTION is enabled, and that the inner #ifdef can safely be removed.

Do you want me to send a patch for this or do you want to do this yourself?

Best regards,

Andreas

[0] https://cados.cs.fau.de
[1] http://www.linuxplumbersconf.org/2014/ocw/proposals/1863

#1 lore raw

Hi Andreas,

Quoted 21 lines · Andreas Ruprecht

Hi Jaegeuk,

your commit c863114122ac ("f2fs crypto: add symlink encryption") showed up in linux-next today (i.e., next-20150521). I noticed it because we run a daily analysis on linux-next, checking for inconsistencies regarding #ifdef blocks [0,1].

In the commit, you create nested #ifdef blocks like the following:

#ifdef CONFIG_F2FS_FS_ENCRYPTION
[...]
#ifdef CONFIG_F2FS_FS_XATTR
[...]
#endif
[...]
#endif

The inner #ifdef, however, is unnecessary as CONFIG_F2FS_FS_XATTR is defined with a dependency on CONFIG_F2FS_FS_ENCRYPTION (line 78 in the corresponding Kconfig file at fs/f2fs/Kconfig).

Quoted 5 lines

This means, CONFIG_F2FS_FS_XATTR can never be disabled if CONFIG_F2FS_FS_ENCRYPTION is enabled, and that the inner #ifdef can safely be removed.

Do you want me to send a patch for this or do you want to do this yourself?

Agreed.
Let me please fix this in the original patch.

Thanks,

Quoted 7 lines

Best regards,

Andreas

[0] https://cados.cs.fau.de
[1] http://www.linuxplumbersconf.org/2014/ocw/proposals/1863