Re: [PATCH] Two small corrections to 2.4.0-test1

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Mon May 29 2000 - 12:23:37 EST


Giacomo Catenazzi wrote:
>
> Hi Alan!
>
> I've found two little (?) error on some include files:
>
> -----------------
> --- include/asm-i386/system.h.old Mon May 29 17:54:25 2000
> +++ include/asm-i386/system.h Mon May 29 17:56:04 2000
> @@ -156,7 +156,7 @@
> "ax","dx","memory");
> }
>
> -extern void inline __set_64bit_constant (unsigned long long *ptr,
> +extern inline void __set_64bit_constant (unsigned long long *ptr,
> unsigned long long value)
> {
> __set_64bit(ptr,(unsigned int)(value), (unsigned
> int)((value)>>32ULL));
> @@ -164,7 +164,7 @@
> #define ll_low(x) *(((unsigned int*)&(x))+0)
> #define ll_high(x) *(((unsigned int*)&(x))+1)
>
> -extern void inline __set_64bit_var (unsigned long long *ptr,
> +extern inline void __set_64bit_var (unsigned long long *ptr,
> unsigned long long value)
> {
> __set_64bit(ptr,ll_low(value), ll_high(value));
> -----------------
>
> and
>
> -------------------
> --- include/net/sock.h.old Mon May 29 17:57:19 2000
> +++ include/net/sock.h Mon May 29 17:58:04 2000
> @@ -712,12 +712,12 @@
> };
>
> /* Called with local bh disabled */
> -static void __inline__ sock_prot_inc_use(struct proto *prot)
> +static __inline__ void sock_prot_inc_use(struct proto *prot)
> {
> prot->stats[smp_processor_id()].inuse++;
> }
>
> -static void __inline__ sock_prot_dec_use(struct proto *prot)
> +static __inline__ void sock_prot_dec_use(struct proto *prot)
> {
> prot->stats[smp_processor_id()].inuse--;
> }
> -------------

The examples you cite, above, should be converted to "static inline",
from "static __inline__" and "extern inline". Changing from 'extern
inline' to 'static inline' is a long term project of mine, because
'extern inline' sometimes doesn't really inline.

> I've found this warning (with some extra warning gcc options):
>
> : /usr/src/4linux/include/linux/sched.h: In function `mmdrop':
> : /usr/src/4linux/include/linux/sched.h:642: warning: can't inline call to
> : `__mmdrop'
> : /usr/src/4linux/include/linux/sched.h:646: warning: called from here

> If you lock the source, you see something strange:
> __mmdrop is only declared inline (I think that it is not allowed by ANSI
> C), inline are to be defined. __mmdrop is defined in kernel/fork.c . Thus
> it can never included in linux/sched.h as inline. Magically linker don't
> issue any errors.

Maybe it shouldn't be inlined at all then. Take a look at where it's
called in fork.c -- if that code is a "hot spot" then it should be left
alone probably..

        Jeff

-- 
Jeff Garzik              | Liberty is always dangerous, but
Building 1024            | it is the safest thing we have.
MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:21 EST