2.4.25pre7 warning fix
PATCH 1/1 2.4.25pre7 warning fix
Hi,
The attached patch fixes the following warning msg:
time.c:435: warning: `do_gettimeoffset_cyclone' defined but not used
There is no need to define functions which do just { return 0; } and which aren't called by anything.
(In case CONFIG_X86_SUMMIT is defined, there is another (real) do_gettimeoffset_cyclone() function, and it is referenced - but it's simply not related to this empty function).
Please apply to 2.4 kernel tree. Thanks.
Signature · 1 line
Krzysztof Halasa, B*FH
arch/i386/kernel/time.c +0 -1
@@ -430,7 +430,6 @@const int use_cyclone =0 ;static void mark_timeoffset_cyclone (void ) {} -static unsigned long do_gettimeoffset_cyclone (void ) {return 0 ;}static void init_cyclone_clock (void ) {}void __cyclone_delay (unsigned long loops) {}#endif /* CONFIG_X86_SUMMIT */
Marcelo Tosatti
AppliedQuoted 4 lines · Krzysztof Halasa
Hi,
The attached patch fixes the following warning msg:
Quoted 8 lines
time.c:435: warning: `do_gettimeoffset_cyclone' defined but not used
There is no need to define functions which do just { return 0; } and which aren't called by anything.
(In case
CONFIG_X86_SUMMITis defined, there is another (real)do_gettimeoffset_cyclone()function, and it is referenced - but it's simply not related to this empty function).
Applied, thanks.
Btw, why do we need cyclone_setup() for !CONFIG_X86_SUMMIT ?
/* No-cyclone stubs */
#ifndef CONFIG_X86_SUMMIT
int __init cyclone_setup(char *str)
{
printk(KERN_ERR "cyclone: Kernel not compiled with
CONFIG_X86_SUMMIT, cannot use the cyclone-timer.\n");
return 1;
}Quoted 10 lines · Marcelo Tosatti
Btw, why do we need
cyclone_setup()for !CONFIG_X86_SUMMIT ?/* No-cyclone stubs */
#ifndefCONFIG_X86_SUMMIT
int__initcyclone_setup(char *str)
{
printk(KERN_ERR "cyclone: Kernel not compiled withCONFIG_X86_SUMMIT, cannot use the cyclone-timer.\n"); return 1; }
No idea. All the stubs seem strange to me. I will make another patch to address that.
Signature · 1 line
Krzysztof Halasa, B*FH
Quoted 10 lines · Marcelo Tosatti
Btw, why do we need
cyclone_setup()for !CONFIG_X86_SUMMIT ?/* No-cyclone stubs */
#ifndefCONFIG_X86_SUMMIT
int__initcyclone_setup(char *str)
{
printk(KERN_ERR "cyclone: Kernel not compiled withCONFIG_X86_SUMMIT, cannot use the cyclone-timer.\n"); return 1; }
After having a closer look at it I think we should:
1. if CONFIG_X86_TSC is set:
- make calibrate_tsc() failure a fatal error
- assume use_tsc = 1 and x86_udelay_tsc = 1 and optimize them out with preprocessor
2. if CONFIG_X86_SUMMIT is _not_ set:
- assume use_cyclone = 0 and optimize it out as well.
- cyclone_setup() etc should go out.
3. I would rename CONFIG_X86_TSC to something like CONFIG_X86_TSC_FORCE
- the current name is misleading. It wouldn't affect .config.
This is all 2.4-only, as 2.6 is a little different here.
Comments?
Signature · 1 line
Krzysztof Halasa, B*FH
Quoted 4 lines · Krzysztof Halasa
Quoted 2 lines · Marcelo Tosatti
Btw, why do we need
cyclone_setup()for !CONFIG_X86_SUMMIT ?
Quoted 8 lines
Quoted 8 lines
/* No-cyclone stubs */
#ifndefCONFIG_X86_SUMMIT
int__initcyclone_setup(char *str)
{
printk(KERN_ERR "cyclone: Kernel not compiled withCONFIG_X86_SUMMIT, cannot use the cyclone-timer.\n"); return 1; }
This is needed because cyclone_setup() is called by detect_clustered_apic(), which may or may not be done on a kernel w/ CONFIG_X86_SUMMIT enabled.
Quoted 7 lines
After having a closer look at it I think we should:
1. if
CONFIG_X86_TSCis set:
- makecalibrate_tsc()failure a fatal error
- assumeuse_tsc= 1 andx86_udelay_tsc= 1 and optimize them out with preprocessor
Sounds fair.
Quoted 3 lines
2. if
CONFIG_X86_SUMMITis _not_ set:
- assumeuse_cyclone= 0 and optimize it out as well.
We already do this.
Quoted 1 line
-
cyclone_setup()etc should go out.
cyclone_setup() is still needed.
Quoted 2 lines
3. I would rename
CONFIG_X86_TSCto something likeCONFIG_X86_TSC_FORCE
- the current name is misleading. It wouldn't affect .config.
Agreed.
thanks
-john