mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [TRIVIAL PATCH] 2.4.25pre7 warning fix
@ 2004-01-27 21:28 Krzysztof Halasa
  2004-01-28 11:42 ` Marcelo Tosatti
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Halasa @ 2004-01-27 21:28 UTC (permalink / raw)
  To: marcelo.tosatti; +Cc: lkml

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

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.
-- 
Krzysztof Halasa, B*FH

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: time-2.4.23pre9.patch --]
[-- Type: text/x-patch, Size: 433 bytes --]

--- linux-2.4.orig/arch/i386/kernel/time.c	2003-10-24 22:48:15.000000000 +0200
+++ linux-2.4/arch/i386/kernel/time.c	2003-11-09 17:38:18.000000000 +0100
@@ -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 */

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

* Re: [TRIVIAL PATCH] 2.4.25pre7 warning fix
  2004-01-27 21:28 [TRIVIAL PATCH] 2.4.25pre7 warning fix Krzysztof Halasa
@ 2004-01-28 11:42 ` Marcelo Tosatti
  2004-01-28 22:17   ` Krzysztof Halasa
  2004-01-29 16:38   ` Krzysztof Halasa
  0 siblings, 2 replies; 5+ messages in thread
From: Marcelo Tosatti @ 2004-01-28 11:42 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: marcelo.tosatti, lkml



On Tue, 27 Jan 2004, Krzysztof Halasa wrote:

> 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).

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;
}



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

* Re: [TRIVIAL PATCH] 2.4.25pre7 warning fix
  2004-01-28 11:42 ` Marcelo Tosatti
@ 2004-01-28 22:17   ` Krzysztof Halasa
  2004-01-29 16:38   ` Krzysztof Halasa
  1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Halasa @ 2004-01-28 22:17 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: lkml

Marcelo Tosatti <marcelo.tosatti@cyclades.com> writes:

> 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;
> }

No idea. All the stubs seem strange to me. I will make another patch
to address that.
-- 
Krzysztof Halasa, B*FH

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

* Re: [TRIVIAL PATCH] 2.4.25pre7 warning fix
  2004-01-28 11:42 ` Marcelo Tosatti
  2004-01-28 22:17   ` Krzysztof Halasa
@ 2004-01-29 16:38   ` Krzysztof Halasa
  2004-01-29 19:22     ` john stultz
  1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Halasa @ 2004-01-29 16:38 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: lkml

Marcelo Tosatti <marcelo.tosatti@cyclades.com> writes:

> 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;
> }

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?
-- 
Krzysztof Halasa, B*FH

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

* Re: [TRIVIAL PATCH] 2.4.25pre7 warning fix
  2004-01-29 16:38   ` Krzysztof Halasa
@ 2004-01-29 19:22     ` john stultz
  0 siblings, 0 replies; 5+ messages in thread
From: john stultz @ 2004-01-29 19:22 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Marcelo Tosatti, lkml

On Thu, 2004-01-29 at 08:38, Krzysztof Halasa wrote:
> Marcelo Tosatti <marcelo.tosatti@cyclades.com> writes:
> 
> > 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;
> > }

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. 

> 
> 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

Sounds fair. 


> 
> 2. if CONFIG_X86_SUMMIT is _not_ set:
>    - assume use_cyclone = 0 and optimize it out as well.

We already do this. 

>    - cyclone_setup() etc should go out.

cyclone_setup() is still needed. 

> 3. I would rename CONFIG_X86_TSC to something like CONFIG_X86_TSC_FORCE
>    - the current name is misleading. It wouldn't affect .config.

Agreed. 


thanks
-john



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

end of thread, other threads:[~2004-01-29 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-27 21:28 [TRIVIAL PATCH] 2.4.25pre7 warning fix Krzysztof Halasa
2004-01-28 11:42 ` Marcelo Tosatti
2004-01-28 22:17   ` Krzysztof Halasa
2004-01-29 16:38   ` Krzysztof Halasa
2004-01-29 19:22     ` john stultz

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

all inboxes | Powered by JetHome®