public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] lib + ntfs: let modules force HWEIGHT
@ 2006-11-28 22:08 Randy Dunlap
  2006-11-29  0:45 ` Andrew Morton
  2006-11-29  8:40 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Randy Dunlap @ 2006-11-28 22:08 UTC (permalink / raw)
  To: lkml; +Cc: akpm, aia21

From: Randy Dunlap <randy.dunlap@oracle.com>

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.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 fs/Kconfig   |    1 +
 lib/Kconfig  |    8 ++++++++
 lib/Makefile |    1 +
 3 files changed, 10 insertions(+)

--- linux-2.6.19-rc6-git10.orig/fs/Kconfig
+++ linux-2.6.19-rc6-git10/fs/Kconfig
@@ -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.
 
--- linux-2.6.19-rc6-git10.orig/lib/Kconfig
+++ linux-2.6.19-rc6-git10/lib/Kconfig
@@ -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
--- linux-2.6.19-rc6-git10.orig/lib/Makefile
+++ linux-2.6.19-rc6-git10/lib/Makefile
@@ -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
 


---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] lib + ntfs: let modules force HWEIGHT
  2006-11-28 22:08 [PATCH 1/2] lib + ntfs: let modules force HWEIGHT Randy Dunlap
@ 2006-11-29  0:45 ` Andrew Morton
  2006-11-29  0:50   ` Randy Dunlap
  2006-12-02 16:56   ` Adrian Bunk
  2006-11-29  8:40 ` Christoph Hellwig
  1 sibling, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2006-11-29  0:45 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, aia21

On Tue, 28 Nov 2006 14:08:40 -0800
Randy Dunlap <randy.dunlap@oracle.com> wrote:

> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> 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.

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] lib + ntfs: let modules force HWEIGHT
  2006-11-29  0:45 ` Andrew Morton
@ 2006-11-29  0:50   ` Randy Dunlap
  2006-12-02 16:56   ` Adrian Bunk
  1 sibling, 0 replies; 6+ messages in thread
From: Randy Dunlap @ 2006-11-29  0:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml, aia21

Andrew Morton wrote:
> On Tue, 28 Nov 2006 14:08:40 -0800
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> 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.
> 
> 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)

-- 
~Randy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] lib + ntfs: let modules force HWEIGHT
  2006-11-28 22:08 [PATCH 1/2] lib + ntfs: let modules force HWEIGHT Randy Dunlap
  2006-11-29  0:45 ` Andrew Morton
@ 2006-11-29  8:40 ` Christoph Hellwig
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2006-11-29  8:40 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, akpm, aia21

On Tue, Nov 28, 2006 at 02:08:40PM -0800, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> 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.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] lib + ntfs: let modules force HWEIGHT
  2006-11-29  0:45 ` Andrew Morton
  2006-11-29  0:50   ` Randy Dunlap
@ 2006-12-02 16:56   ` Adrian Bunk
  2006-12-02 17:00     ` Randy Dunlap
  1 sibling, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2006-12-02 16:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Randy Dunlap, lkml, aia21

On Tue, Nov 28, 2006 at 04:45:38PM -0800, Andrew Morton wrote:
> On Tue, 28 Nov 2006 14:08:40 -0800
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > 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.
> 
> 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

-- 

       "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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] lib + ntfs: let modules force HWEIGHT
  2006-12-02 16:56   ` Adrian Bunk
@ 2006-12-02 17:00     ` Randy Dunlap
  0 siblings, 0 replies; 6+ messages in thread
From: Randy Dunlap @ 2006-12-02 17:00 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, lkml, aia21

Adrian Bunk wrote:
> On Tue, Nov 28, 2006 at 04:45:38PM -0800, Andrew Morton wrote:
>> On Tue, 28 Nov 2006 14:08:40 -0800
>> Randy Dunlap <randy.dunlap@oracle.com> wrote:
>>
>>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>>
>>> 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.
>> 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.

-- 
~Randy

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-12-02 17:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28 22:08 [PATCH 1/2] lib + ntfs: let modules force HWEIGHT Randy Dunlap
2006-11-29  0:45 ` Andrew Morton
2006-11-29  0:50   ` Randy Dunlap
2006-12-02 16:56   ` Adrian Bunk
2006-12-02 17:00     ` Randy Dunlap
2006-11-29  8:40 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox