Skip to contentSkip to conversation

cramfs: fix MTD dependency

PATCH In review Arnd Bergmann 2 participants 8 messages Nov 10, 2017 – Nov 21, 2017 Cramfs filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cramfs: fix MTD dependency

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +1 -0
index f937082f3244..58e2fe40b2a0 100644
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
 	bool "Support CramFs image directly mapped in physical memory"
 	depends on CRAMFS && MTD
+	depends on CRAMFS=m || MTD=y
 	default y if !CRAMFS_BLOCKDEV
 	help
 	  This option allows the CramFs driver to load data directly from
Signature · 1 line
2.9.0
#1 lore raw
Quoted 23 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +0 -0
index f937082f3244..58e2fe40b2a0 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 37

Quoted 4 lines
fs/cramfs/Kconfig +1 -0
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
 	bool "Support CramFs image directly mapped in physical memory"
 	depends on CRAMFS && MTD
+	depends on CRAMFS=m || MTD=y

I think the following is better:

fs/cramfs/Kconfig +1 -1
index f937082f32..a00740c668 100644
@@ -33,7 +33,7 @@ config CRAMFS_BLOCKDEV
 
 config CRAMFS_MTD
 	bool "Support CramFs image directly mapped in physical memory"
-	depends on CRAMFS && MTD
+	depends on CRAMFS && (CRAMFS <= MTD)
 	default y if !CRAMFS_BLOCKDEV
 	help
 	  This option allows the CramFs driver to load data directly from

Nicolas

#2 lore raw
Quoted 37 lines · Nicolas Pitre
Quoted 23 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +0 -0
index f937082f3244..58e2fe40b2a0 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 37

Quoted 4 lines
fs/cramfs/Kconfig +1 -0
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
      bool "Support CramFs image directly mapped in physical memory"
      depends on CRAMFS && MTD
+     depends on CRAMFS=m || MTD=y

I think the following is better:

fs/cramfs/Kconfig +0 -0
index f937082f32..a00740c668 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 39

Quoted 8 lines
fs/cramfs/Kconfig +1 -1
@@ -33,7 +33,7 @@ config CRAMFS_BLOCKDEV
 
 config CRAMFS_MTD
        bool "Support CramFs image directly mapped in physical memory"
-       depends on CRAMFS && MTD
+       depends on CRAMFS && (CRAMFS <= MTD)
        default y if !CRAMFS_BLOCKDEV
        help
          This option allows the CramFs driver to load data directly from

I've never seen that syntax, what does it mean?

Arnd

#3 lore raw
Quoted 39 lines · Arnd Bergmann
Quoted 38 lines · Nicolas Pitre
Quoted 23 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +0 -0
index f937082f3244..58e2fe40b2a0 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 37

Quoted 4 lines
fs/cramfs/Kconfig +1 -0
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
      bool "Support CramFs image directly mapped in physical memory"
      depends on CRAMFS && MTD
+     depends on CRAMFS=m || MTD=y

I think the following is better:

fs/cramfs/Kconfig +0 -0
index f937082f32..a00740c668 100644
@@ -33,7 +33,7 @@ config CRAMFS_BLOCKDEV
 
Quoted 9 lines

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 39

Quoted 7 lines
fs/cramfs/Kconfig +1 -1
 config CRAMFS_MTD
        bool "Support CramFs image directly mapped in physical memory"
-       depends on CRAMFS && MTD
+       depends on CRAMFS && (CRAMFS <= MTD)
        default y if !CRAMFS_BLOCKDEV
        help
          This option allows the CramFs driver to load data directly from

I've never seen that syntax, what does it mean?

In the Kconfig language: n < m < y. Therefore (m < y) is true and (y < m) is false.

Nicolas

#4 lore raw
Quoted 51 lines · Nicolas Pitre
Quoted 39 lines · Arnd Bergmann
Quoted 38 lines · Nicolas Pitre
Quoted 23 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +0 -0
index f937082f3244..58e2fe40b2a0 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 37

Quoted 4 lines
fs/cramfs/Kconfig +1 -0
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
      bool "Support CramFs image directly mapped in physical memory"
      depends on CRAMFS && MTD
+     depends on CRAMFS=m || MTD=y

I think the following is better:

fs/cramfs/Kconfig +0 -0
index f937082f32..a00740c668 100644
@@ -33,7 +33,7 @@ config CRAMFS_BLOCKDEV
 
Quoted 9 lines

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 39

Quoted 7 lines
fs/cramfs/Kconfig +1 -1
 config CRAMFS_MTD
        bool "Support CramFs image directly mapped in physical memory"
-       depends on CRAMFS && MTD
+       depends on CRAMFS && (CRAMFS <= MTD)
        default y if !CRAMFS_BLOCKDEV
        help
          This option allows the CramFs driver to load data directly from

I've never seen that syntax, what does it mean?

Quoted 2 lines

In the Kconfig language: n < m < y. Therefore (m < y) is true and (y < m) is false.

I see. However, since I didn't recognize that syntax, and it doesn't seem to be used much, I would still prefer my original suggestion, which I think is more common.

Arnd

#5 lore raw
Quoted 52 lines · Arnd Bergmann
Quoted 51 lines · Nicolas Pitre
Quoted 48 lines · Arnd Bergmann
Quoted 37 lines · Nicolas Pitre
Quoted 23 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +0 -0
index f937082f3244..58e2fe40b2a0 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 37

Quoted 4 lines
fs/cramfs/Kconfig +1 -0
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
      bool "Support CramFs image directly mapped in physical memory"
      depends on CRAMFS && MTD
+     depends on CRAMFS=m || MTD=y

I think the following is better:

fs/cramfs/Kconfig +0 -0
index f937082f32..a00740c668 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 39

Quoted 8 lines
fs/cramfs/Kconfig +1 -1
@@ -33,7 +33,7 @@ config CRAMFS_BLOCKDEV
 
 config CRAMFS_MTD
        bool "Support CramFs image directly mapped in physical memory"
-       depends on CRAMFS && MTD
+       depends on CRAMFS && (CRAMFS <= MTD)
        default y if !CRAMFS_BLOCKDEV
        help
          This option allows the CramFs driver to load data directly from

I've never seen that syntax, what does it mean?

Quoted 6 lines
Quoted 2 lines

In the Kconfig language: n < m < y. Therefore (m < y) is true and (y < m) is false.

I see. However, since I didn't recognize that syntax, and it doesn't seem to be used much, I would still prefer my original suggestion, which I think is more common.

How can a "better" way become common enough for you to use it if you don't contribute to make it more common?

Nicolas

#6 lore raw
Quoted 57 lines · Nicolas Pitre
Quoted 55 lines · Arnd Bergmann
Quoted 53 lines · Nicolas Pitre
Quoted 39 lines · Arnd Bergmann
Quoted 38 lines · Nicolas Pitre
Quoted 23 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +0 -0
index f937082f3244..58e2fe40b2a0 100644

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 37

Quoted 4 lines
fs/cramfs/Kconfig +1 -0
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
      bool "Support CramFs image directly mapped in physical memory"
      depends on CRAMFS && MTD
+     depends on CRAMFS=m || MTD=y

I think the following is better:

fs/cramfs/Kconfig +0 -0
index f937082f32..a00740c668 100644
@@ -33,7 +33,7 @@ config CRAMFS_BLOCKDEV
 
Quoted 9 lines

fs/cramfs/Kconfig config CRAMFS_BLOCKDEV · line 39

Quoted 7 lines
fs/cramfs/Kconfig +1 -1
 config CRAMFS_MTD
        bool "Support CramFs image directly mapped in physical memory"
-       depends on CRAMFS && MTD
+       depends on CRAMFS && (CRAMFS <= MTD)
        default y if !CRAMFS_BLOCKDEV
        help
          This option allows the CramFs driver to load data directly from

I've never seen that syntax, what does it mean?

In the Kconfig language: n < m < y. Therefore (m < y) is true and (y < m) is false.

Quoted 6 lines
Quoted 3 lines

I see. However, since I didn't recognize that syntax, and it doesn't seem to be used much, I would still prefer my original suggestion, which I think is more common.

How can a "better" way become common enough for you to use it if you don't contribute to make it more common?

FYI, this ability was introduced in commit 31847b67bec0 i.e. Linux v4.2. That's relatively recent and might explain why it has not been used much so far... and the fact that no one updated Documentation/kbuild/kconfig-language.txt to match.

However, while documenting it, I wanted to test the actual expression result and stumbled on a problem. The comparison for bool/tristate symbols is done as if those were plain strings i.e. "m" < "n" < "y". I've produced a patch to fix this.

Nicolas

#7 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

With CONFIG_MTD=m and CONFIG_CRAMFS=y, we now get a link failure:

fs/cramfs/inode.o: In function `cramfs_mount':
inode.c:(.text+0x220): undefined reference to mount_mtd' fs/cramfs/inode.o: In function cramfs_mtd_fill_super':
inode.c:(.text+0x6d8): undefined reference to mtd_point' inode.c:(.text+0xae4): undefined reference to mtd_unpoint'

Quoted 6 lines

This adds a more specific Kconfig dependency to avoid the broken configuration. Alternatively we could make CRAMFS itself depend on "MTD || !MTD" with a similar result.

Fixes 99c18ce580c6 ("cramfs: direct memory access support")

Well, my alternative fix depends on a kconfig fix which has not received any feedback yet. So let's do the obvious for now to cut on the build breakage reports. Please could you push your patch upstream?

Acked-by- Nicolas Pitre <[email protected]>

Quoted 20 lines
---
 fs/cramfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/cramfs/Kconfig +1 -0
index f937082f3244..58e2fe40b2a0 100644
@@ -34,6 +34,7 @@ config CRAMFS_BLOCKDEV
 config CRAMFS_MTD
 	bool "Support CramFs image directly mapped in physical memory"
 	depends on CRAMFS && MTD
+	depends on CRAMFS=m || MTD=y
 	default y if !CRAMFS_BLOCKDEV
 	help
 	  This option allows the CramFs driver to load data directly from
Signature · 1 line
2.9.0