Skip to contentSkip to conversation

UBI(FS): fixing IS_ENABLED() usage + backport trees

PATCH In review Brian Norris 2 participants 6 messages Jun 18, 2012 – Jul 16, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover UBI(FS): fixing IS_ENABLED() usage + backport trees

Hi Artem,

It looks like your ubifs-v3.3.git tree does not compile successfully. I think there are two issues:

1) IS_ENABLED() should be used with the CONFIG_ prefix. i.e., IS_ENABLED(CONFIG_DEBUG_FS) instead of IS_ENABLED(DEBUG_FS)

2) IS_ENABLED() has changed some between v3.3 and when this commit was originally integrated in mainline, so it masks a compile error in the mainline version

This patch series addresses issue 1. I suggest that this be backported to the appropriate UBIFS tree to solve some build failures. But I think issue 2 may still be a problem, so perhaps the mainline IS_ENABLED() fix should be backported as well?

BTW, there may be more than one backport tree that fails; I just tested v3.3.

UBIFS commit (mainline) that breaks when ported to v3.3:
5e0c43e74d16db5710caebe8169995c9a13807f9

Upstream commit that fixes IS_ENABLED:
69349c2dc01c489eccaa4c472542c08e370c6d7e

Build failure in ubifs-v3.3.git:

CC drivers/mtd/ubi/debug.o
drivers/mtd/ubi/debug.c: In function ‘ubi_debugfs_init’:
drivers/mtd/ubi/debug.c:267: error: ‘__enabled_DEBUG_FS’ undeclared (first use in this function) drivers/mtd/ubi/debug.c:267: error: (Each undeclared identifier is reported only once drivers/mtd/ubi/debug.c:267: error: for each function it appears in.) drivers/mtd/ubi/debug.c:267: error: ‘__enabled_DEBUG_FS_MODULE’ undeclared (first use in this function) drivers/mtd/ubi/debug.c: In function ‘ubi_debugfs_exit’:
drivers/mtd/ubi/debug.c:287: error: ‘__enabled_DEBUG_FS’ undeclared (first use in this function) drivers/mtd/ubi/debug.c:287: error: ‘__enabled_DEBUG_FS_MODULE’ undeclared (first use in this function) drivers/mtd/ubi/debug.c: In function ‘ubi_debugfs_init_dev’:
drivers/mtd/ubi/debug.c:418: error: ‘__enabled_DEBUG_FS’ undeclared (first use in this function) drivers/mtd/ubi/debug.c:418: error: ‘__enabled_DEBUG_FS_MODULE’ undeclared (first use in this function) drivers/mtd/ubi/debug.c: In function ‘ubi_debugfs_exit_dev’:
drivers/mtd/ubi/debug.c:488: error: ‘__enabled_DEBUG_FS’ undeclared (first use in this function) drivers/mtd/ubi/debug.c:488: error: ‘__enabled_DEBUG_FS_MODULE’ undeclared (first use in this function) make[3]: *** [drivers/mtd/ubi/debug.o] Error 1
make[2]: *** [drivers/mtd/ubi] Error 2
make[1]: *** [drivers/mtd] Error 2
make[1]: *** Waiting for unfinished jobs....

Regards,
Brian

Brian Norris (2):
UBIFS: correct usage of IS_ENABLED()
UBI: correct usage of IS_ENABLED()

 drivers/mtd/ubi/debug.c |    8 ++++----
 fs/ubifs/debug.c        |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
#1 lore raw

PATCH 1/2 UBIFS: correct usage of IS_ENABLED()

IS_ENABLED() arguments should be used with the CONFIG_* prefix.

---
based on ubifs.git

 fs/ubifs/debug.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
fs/ubifs/debug.c +4 -4
index 84a7e6f..92df3b0 100644
@@ -2918,7 +2918,7 @@ int dbg_debugfs_init_fs(struct ubifs_info *c)
 	struct dentry *dent;
 	struct ubifs_debug_info *d = c->dbg;
 
-	if (!IS_ENABLED(DEBUG_FS))
+	if (!IS_ENABLED(CONFIG_DEBUG_FS))
 		return 0;
 
 	n = snprintf(d->dfs_dir_name, UBIFS_DFS_DIR_LEN + 1, UBIFS_DFS_DIR_NAME,
@@ -3013,7 +3013,7 @@ out:
  */
 void dbg_debugfs_exit_fs(struct ubifs_info *c)
 {
-	if (IS_ENABLED(DEBUG_FS))
+	if (IS_ENABLED(CONFIG_DEBUG_FS))
 		debugfs_remove_recursive(c->dbg->dfs_dir);
 }
 
@@ -3099,7 +3099,7 @@ int dbg_debugfs_init(void)
 	const char *fname;
 	struct dentry *dent;
 
-	if (!IS_ENABLED(DEBUG_FS))
+	if (!IS_ENABLED(CONFIG_DEBUG_FS))
 		return 0;
 
 	fname = "ubifs";
@@ -3166,7 +3166,7 @@ out:
  */
 void dbg_debugfs_exit(void)
 {
-	if (IS_ENABLED(DEBUG_FS))
+	if (IS_ENABLED(CONFIG_DEBUG_FS))
 		debugfs_remove_recursive(dfs_rootdir);
 }
 
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/2 UBI: correct usage of IS_ENABLED()

In reply to Brian Norris

IS_ENABLED() arguments should be used with the CONFIG_* prefix.

---
based on ubifs.git

 drivers/mtd/ubi/debug.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/ubi/debug.c +4 -4
index 09d4f8d..7c13803 100644
@@ -264,7 +264,7 @@ static struct dentry *dfs_rootdir;
  */
 int ubi_debugfs_init(void)
 {
-	if (!IS_ENABLED(DEBUG_FS))
+	if (!IS_ENABLED(CONFIG_DEBUG_FS))
 		return 0;
 
 	dfs_rootdir = debugfs_create_dir("ubi", NULL);
@@ -284,7 +284,7 @@ int ubi_debugfs_init(void)
  */
 void ubi_debugfs_exit(void)
 {
-	if (IS_ENABLED(DEBUG_FS))
+	if (IS_ENABLED(CONFIG_DEBUG_FS))
 		debugfs_remove(dfs_rootdir);
 }
 
@@ -407,7 +407,7 @@ int ubi_debugfs_init_dev(struct ubi_device *ubi)
 	struct dentry *dent;
 	struct ubi_debug_info *d = ubi->dbg;
 
-	if (!IS_ENABLED(DEBUG_FS))
+	if (!IS_ENABLED(CONFIG_DEBUG_FS))
 		return 0;
 
 	n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME,
@@ -477,6 +477,6 @@ out:
  */
 void ubi_debugfs_exit_dev(struct ubi_device *ubi)
 {
-	if (IS_ENABLED(DEBUG_FS))
+	if (IS_ENABLED(CONFIG_DEBUG_FS))
 		debugfs_remove_recursive(ubi->dbg->dfs_dir);
 }
Signature · 1 line
1.7.0.4
#3 lore raw
In reply to Brian Norris
Quoted 7 lines · Brian Norris

Hi Artem,

It looks like your ubifs-v3.3.git tree does not compile successfully. I think there are two issues:

1) IS_ENABLED() should be used with the CONFIG_ prefix. i.e., IS_ENABLED(CONFIG_DEBUG_FS) instead of IS_ENABLED(DEBUG_FS)

Thanks, I've pushed this to linux-ubifs.git. I'll let is sit there for few days and get exposed to linux-next and then send a pull request to Linus.

Quoted 4 lines

2) IS_ENABLED() has changed some between v3.3 and when this commit was originally integrated in mainline, so it masks a compile error in the mainline version

Not sure what you mean. It was introduced in 3.1 (2a11c8ea20bf850b3a2c60db8c2e7497d28aba99), so I have to back-port it older ubifs backport trees.

Quoted 4 lines

This patch series addresses issue 1. I suggest that this be backported to the appropriate UBIFS tree to solve some build failures. But I think issue 2 may still be a problem, so perhaps the mainline IS_ENABLED() fix should be backported as well?

I guess you are talking about commit 69349c2dc01c489eccaa4c472542c08e370c6d7e ? I'll port it too, thanks.

Quoted 2 lines

BTW, there may be more than one backport tree that fails; I just tested v3.3.

I'll check.

Thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#4 lore raw
Quoted 8 lines · Artem Bityutskiy
Quoted 3 lines · Brian Norris

 2) IS_ENABLED() has changed some between v3.3 and when this commit was originally integrated in mainline, so it masks a compile error in the mainline version

Not sure what you mean. It was introduced in 3.1 (2a11c8ea20bf850b3a2c60db8c2e7497d28aba99), so I have to back-port it older ubifs backport trees.

I was referring to
kconfig: fix IS_ENABLED to not require all options to be defined 69349c2dc01c489eccaa4c472542c08e370c6d7e
which was introduced in 3.4. I think this masks some errors in your mainline patch, but when you backport between 3.1..3.4-rc2, you get compilation errors.

Quoted 7 lines
Quoted 4 lines

This patch series addresses issue 1. I suggest that this be backported to the appropriate UBIFS tree to solve some build failures. But I think issue 2 may still be a problem, so perhaps the mainline IS_ENABLED() fix should be backported as well?

I guess you are talking about commit 69349c2dc01c489eccaa4c472542c08e370c6d7e ? I'll port it too, thanks.

Right, I was talking about this fix (above); but on second thought, you may not need to port it. It is only needed to mask your error, but now that it's fixed, you don't need the port. But I didn't look very closely :)

Regards,
Brian

#5 lore raw
Quoted 10 lines · Brian Norris
Quoted 8 lines · Artem Bityutskiy
Quoted 3 lines · Brian Norris

2) IS_ENABLED() has changed some between v3.3 and when this commit was originally integrated in mainline, so it masks a compile error in the mainline version

Not sure what you mean. It was introduced in 3.1 (2a11c8ea20bf850b3a2c60db8c2e7497d28aba99), so I have to back-port it older ubifs backport trees.

Quoted 6 lines

I was referring to
kconfig: fix IS_ENABLED to not require all options to be defined 69349c2dc01c489eccaa4c472542c08e370c6d7e
which was introduced in 3.4. I think this masks some errors in your mainline patch, but when you backport between 3.1..3.4-rc2, you get compilation errors.

I think I fixed all the backport trees, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy