Skip to contentSkip to conversation

lib + ntfs: let modules force HWEIGHT

PATCH In review Randy Dunlap 4 participants 6 messages Nov 28, 2006 – Dec 2, 2006

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

PATCH 1/2 lib + ntfs: let modules force HWEIGHT

From: Randy Dunlap <[email protected]>

NTFS (=m) uses hweight32(), but that function is only linked into the kernel image if it is used inside the kernel image, not in loadable modules. Let modules force HWEIGHT to be built into the kernel image. Otherwise build fails:

Building modules, stage 2.
MODPOST 94 modules
WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!

Yes, I'd certainly prefer for this to be more automated rather than forced by each module that needs it.

---
 fs/Kconfig   |    1 +
 lib/Kconfig  |    8 ++++++++
 lib/Makefile |    1 +
 3 files changed, 10 insertions(+)
fs/Kconfig +1 -0
@@ -816,6 +816,7 @@ config FAT_DEFAULT_IOCHARSET
 config NTFS_FS
 	tristate "NTFS file system support"
 	select NLS
+	select FORCE_HWEIGHT
 	help
 	  NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
 
lib/Kconfig +8 -0
@@ -97,4 +97,12 @@ config TEXTSEARCH_FSM
 config PLIST
 	boolean
 
+#
+# FORCE_HWEIGHT support is select-ed if needed,
+# so that loadable modules can cause the kernel to supply it
+# (and not be dropped from lib.a when not used in kernel image)
+#
+config FORCE_HWEIGHT
+	boolean
+
 endmenu
lib/Makefile +1 -0
@@ -28,6 +28,7 @@ lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += f
 lib-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
 obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
 obj-$(CONFIG_PLIST) += plist.o
+obj-$(CONFIG_FORCE_HWEIGHT) += hweight.o
 obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o
 obj-$(CONFIG_DEBUG_LIST) += list_debug.o
 

---

#1 lore raw
Quoted 7 lines · On Tue, 28 Nov 2006 14:08:40 -0800 Randy Dunlap <[email protected]> wrote:

From: Randy Dunlap <[email protected]>

NTFS (=m) uses hweight32(), but that function is only linked into the kernel image if it is used inside the kernel image, not in loadable modules. Let modules force HWEIGHT to be built into the kernel image. Otherwise build fails:

Quoted 6 lines

Building modules, stage 2.
MODPOST 94 modules
WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!

Yes, I'd certainly prefer for this to be more automated rather than forced by each module that needs it.

Perhaps we should just put it in lib-y and remove CONFIG_GENERIC_HWEIGHT. It's either part of the API or it ain't.

#2 lore raw
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Tue, 28 Nov 2006 14:08:40 -0800 Randy Dunlap <[email protected]> wrote:

From: Randy Dunlap <[email protected]>

NTFS (=m) uses hweight32(), but that function is only linked into the kernel image if it is used inside the kernel image, not in loadable modules. Let modules force HWEIGHT to be built into the kernel image. Otherwise build fails:

Building modules, stage 2.
MODPOST 94 modules
WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!

Quoted 5 lines
Quoted 2 lines

Yes, I'd certainly prefer for this to be more automated rather than forced by each module that needs it.

Perhaps we should just put it in lib-y and remove CONFIG_GENERIC_HWEIGHT. It's either part of the API or it ain't.

Yes, that matches how I feel about it, but I expected some disagreement (from elsewhere, not from you).

I'll send another patch later. Replacement patch OK? (vs. update)

Signature · 1 line
~Randy
#3 lore raw
In reply to Andrew Morton
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Tue, 28 Nov 2006 14:08:40 -0800 Randy Dunlap <[email protected]> wrote:

From: Randy Dunlap <[email protected]>

NTFS (=m) uses hweight32(), but that function is only linked into the kernel image if it is used inside the kernel image, not in loadable modules. Let modules force HWEIGHT to be built into the kernel image. Otherwise build fails:

Building modules, stage 2.
MODPOST 94 modules
WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!

Quoted 5 lines
Quoted 2 lines

Yes, I'd certainly prefer for this to be more automated rather than forced by each module that needs it.

Perhaps we should just put it in lib-y and remove CONFIG_GENERIC_HWEIGHT.
...

This will obviously not help in this case...

EXPORT_SYMBOL() in a lib-* is always a bug.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
Quoted 15 lines · Adrian Bunk
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Tue, 28 Nov 2006 14:08:40 -0800 Randy Dunlap <[email protected]> wrote:

From: Randy Dunlap <[email protected]>

NTFS (=m) uses hweight32(), but that function is only linked into the kernel image if it is used inside the kernel image, not in loadable modules. Let modules force HWEIGHT to be built into the kernel image. Otherwise build fails:

Building modules, stage 2.
MODPOST 94 modules
WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Yes, I'd certainly prefer for this to be more automated rather than forced by each module that needs it.

Perhaps we should just put it in lib-y and remove CONFIG_GENERIC_HWEIGHT.
...

This will obviously not help in this case...

EXPORT_SYMBOL() in a lib-* is always a bug.

so I changed hweight.o to always be in obj-y instead of lib-y.

Signature · 1 line
~Randy
#5 lore raw
In reply to Randy Dunlap
Quoted 7 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

NTFS (=m) uses hweight32(), but that function is only linked into the kernel image if it is used inside the kernel image, not in loadable modules. Let modules force HWEIGHT to be built into the kernel image. Otherwise build fails:

Quoted 6 lines

Building modules, stage 2.
MODPOST 94 modules
WARNING: "hweight32" [fs/ntfs/ntfs.ko] undefined!

Yes, I'd certainly prefer for this to be more automated rather than forced by each module that needs it.

Please just make it builtin-in always and remove it from lib-y. Bonus points for killing of the lib-y braindamage entirely.