* Confusion about unused variable warnings during kernel build.
@ 2008-10-29 6:33 Manish Katiyar
2008-10-30 18:32 ` Mulyadi Santosa
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Manish Katiyar @ 2008-10-29 6:33 UTC (permalink / raw)
To: kernel-janitors
Hi,
Occasionally during kernel builds I get some unused variable warnings.
But when I go and check the code the variable is getting used.
Interestingly I have seen this problem only with the file symbols
exported from fs/locks.c. An example of such errors is
fs/lockd/svclock.c:719: warning: unused variable 'file'
fs/nfsd/nfsxdr.c:154: warning: unused variable 'dentry'
fs/nfsd/nfs4state.c:1626: warning: unused variable 'flp'
Is there some problem with the way symbols are exported ?? Out of the
above 3, 2 of them are exported as EXPORT_SYMBOL_GPL and one of them
as EXPORT_SYMBOL
Thanks -
Manish
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Confusion about unused variable warnings during kernel build.
2008-10-29 6:33 Confusion about unused variable warnings during kernel build Manish Katiyar
@ 2008-10-30 18:32 ` Mulyadi Santosa
2008-10-30 19:12 ` Marcin Slusarz
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Mulyadi Santosa @ 2008-10-30 18:32 UTC (permalink / raw)
To: kernel-janitors
Hi man...
On Wed, Oct 29, 2008 at 1:21 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> Hi,
>
> Occasionally during kernel builds I get some unused variable warnings.
> But when I go and check the code the variable is getting used.
> Interestingly I have seen this problem only with the file symbols
> exported from fs/locks.c. An example of such errors is
>
> fs/lockd/svclock.c:719: warning: unused variable 'file'
> fs/nfsd/nfsxdr.c:154: warning: unused variable 'dentry'
> fs/nfsd/nfs4state.c:1626: warning: unused variable 'flp'
>
> Is there some problem with the way symbols are exported ?? Out of the
> above 3, 2 of them are exported as EXPORT_SYMBOL_GPL and one of them
> as EXPORT_SYMBOL
My best guess so far is: probably they "seem" not being used because
they are just variable that are not really being used and end up
simply exported? or perhaps they are "aliased" (not sure if I use
correct term...it's kinda using pointer that simply points to them or
something like them).
regards,
Mulyadi.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Confusion about unused variable warnings during kernel build.
2008-10-29 6:33 Confusion about unused variable warnings during kernel build Manish Katiyar
2008-10-30 18:32 ` Mulyadi Santosa
@ 2008-10-30 19:12 ` Marcin Slusarz
2008-10-31 1:53 ` Manish Katiyar
2008-10-31 13:45 ` Nick Andrew
3 siblings, 0 replies; 5+ messages in thread
From: Marcin Slusarz @ 2008-10-30 19:12 UTC (permalink / raw)
To: kernel-janitors
On Wed, Oct 29, 2008 at 11:51:20AM +0530, Manish Katiyar wrote:
> Hi,
>
> Occasionally during kernel builds I get some unused variable warnings.
> But when I go and check the code the variable is getting used.
> Interestingly I have seen this problem only with the file symbols
> exported from fs/locks.c. An example of such errors is
>
> fs/lockd/svclock.c:719: warning: unused variable 'file'
> fs/nfsd/nfsxdr.c:154: warning: unused variable 'dentry'
> fs/nfsd/nfs4state.c:1626: warning: unused variable 'flp'
Check the definition of functions which "use" these variables.
Marcin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Confusion about unused variable warnings during kernel build.
2008-10-29 6:33 Confusion about unused variable warnings during kernel build Manish Katiyar
2008-10-30 18:32 ` Mulyadi Santosa
2008-10-30 19:12 ` Marcin Slusarz
@ 2008-10-31 1:53 ` Manish Katiyar
2008-10-31 13:45 ` Nick Andrew
3 siblings, 0 replies; 5+ messages in thread
From: Manish Katiyar @ 2008-10-31 1:53 UTC (permalink / raw)
To: kernel-janitors
On Fri, Oct 31, 2008 at 12:42 AM, Marcin Slusarz
<marcin.slusarz@gmail.com> wrote:
> On Wed, Oct 29, 2008 at 11:51:20AM +0530, Manish Katiyar wrote:
>> Hi,
>>
>> Occasionally during kernel builds I get some unused variable warnings.
>> But when I go and check the code the variable is getting used.
>> Interestingly I have seen this problem only with the file symbols
>> exported from fs/locks.c. An example of such errors is
>>
>> fs/lockd/svclock.c:719: warning: unused variable 'file'
>> fs/nfsd/nfsxdr.c:154: warning: unused variable 'dentry'
>> fs/nfsd/nfs4state.c:1626: warning: unused variable 'flp'
>
> Check the definition of functions which "use" these variables.
I checked them and they are very much used. I can understand if they
would have been in some #ifdef but that doesn't seem to be the case
here.
Thanks -
Manish
>
> Marcin
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Confusion about unused variable warnings during kernel build.
2008-10-29 6:33 Confusion about unused variable warnings during kernel build Manish Katiyar
` (2 preceding siblings ...)
2008-10-31 1:53 ` Manish Katiyar
@ 2008-10-31 13:45 ` Nick Andrew
3 siblings, 0 replies; 5+ messages in thread
From: Nick Andrew @ 2008-10-31 13:45 UTC (permalink / raw)
To: kernel-janitors
On Fri, Oct 31, 2008 at 07:23:04AM +0530, Manish Katiyar wrote:
> On Fri, Oct 31, 2008 at 12:42 AM, Marcin Slusarz
> <marcin.slusarz@gmail.com> wrote:
> > Check the definition of functions which "use" these variables.
>
> I checked them and they are very much used. I can understand if they
> would have been in some #ifdef but that doesn't seem to be the case
> here.
I think the functions end up being #defined away into nothing,
in certain cases. In the first example you mentioned with
fs/lockd/svclock.c the vfs_lock_file function gets #defined as
"(-ENOLCK)" in include/linux/fs.h if CONFIG_FILE_LOCKING is not set,
so I guess that's how you configured your kernel.
Nick.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-31 13:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 6:33 Confusion about unused variable warnings during kernel build Manish Katiyar
2008-10-30 18:32 ` Mulyadi Santosa
2008-10-30 19:12 ` Marcin Slusarz
2008-10-31 1:53 ` Manish Katiyar
2008-10-31 13:45 ` Nick Andrew
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.