2004-11-03 08:04:35

by Vadim Lobanov

[permalink] [raw]
Subject: [TRIVIAL PATCH] /init/version.c

Hi,

This is a trivial patch to save a word-length worth of space. Just
something that seemed easy to do while I was reading over the source
code.

Diffed against 2.6.9:
=================================================
--- version.c.orig 2004-11-02 23:54:03.000000000 -0800
+++ version.c 2004-11-02 23:54:36.000000000 -0800
@@ -28,6 +28,6 @@

EXPORT_SYMBOL(system_utsname);

-const char *linux_banner =
+const char linux_banner[] =
"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
=================================================

After looking over the MAINTAINERS file, I have no idea who the right
point of contact / maintainer is for this code. (Or, I simply missed the
right entry while reading, which has been known to happen.) Please advise.

Signed-off-by: Vadim Lobanov


2004-11-03 08:29:44

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [TRIVIAL PATCH] /init/version.c

>Hi,
>
>After looking over the MAINTAINERS file, I have no idea who the right
>point of contact / maintainer is for this code. (Or, I simply missed the
>right entry while reading, which has been known to happen.) Please advise.

As stated in the MAINTAINERS file at the end, everything else goes to Linus.



Jan Engelhardt
--
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, http://www.gwdg.de

2004-11-03 10:29:49

by Denis Vlasenko

[permalink] [raw]
Subject: Re: [TRIVIAL PATCH] /init/version.c

On Wednesday 03 November 2004 10:29, Jan Engelhardt wrote:
> >Hi,
> >
> >After looking over the MAINTAINERS file, I have no idea who the right
> >point of contact / maintainer is for this code. (Or, I simply missed the
> >right entry while reading, which has been known to happen.) Please advise.
>
> As stated in the MAINTAINERS file at the end, everything else goes to Linus.

However, I suspect it won't even compile.

See:
http://lxr.linux.no/source/init/main.c?v=2.6.8.1#L76
http://lxr.linux.no/source/fs/proc/proc_misc.c?v=2.6.8.1#L253
--
vda

2004-11-03 16:36:07

by Vadim Lobanov

[permalink] [raw]
Subject: Re: [TRIVIAL PATCH] /init/version.c

It seems to compile just fine. Here are the relevant snippets:

UPD include/asm-i386/asm_offsets.h
CC init/main.o
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
CC init/do_mounts.o

...and...

CC fs/proc/proc_tty.o
CC fs/proc/proc_misc.o
CC fs/proc/kcore.o

Why did you believe it would not compile? (Just so I can be extra
careful about this kind of code in the future.)

-Vadim Lobanov

On Wed, 3 Nov 2004, Denis Vlasenko wrote:

> On Wednesday 03 November 2004 10:29, Jan Engelhardt wrote:
> > >Hi,
> > >
> > >After looking over the MAINTAINERS file, I have no idea who the right
> > >point of contact / maintainer is for this code. (Or, I simply missed the
> > >right entry while reading, which has been known to happen.) Please advise.
> >
> > As stated in the MAINTAINERS file at the end, everything else goes to Linus.
>
> However, I suspect it won't even compile.
>
> See:
> http://lxr.linux.no/source/init/main.c?v=2.6.8.1#L76
> http://lxr.linux.no/source/fs/proc/proc_misc.c?v=2.6.8.1#L253
> --
> vda
>
>

2004-11-03 21:18:47

by Denis Vlasenko

[permalink] [raw]
Subject: Re: [TRIVIAL PATCH] /init/version.c

On Wednesday 03 November 2004 18:34, vlobanov wrote:
> It seems to compile just fine. Here are the relevant snippets:
>
> UPD include/asm-i386/asm_offsets.h
> CC init/main.o
> CHK include/linux/compile.h
> UPD include/linux/compile.h
> CC init/version.o
> CC init/do_mounts.o
>
> ...and...
>
> CC fs/proc/proc_tty.o
> CC fs/proc/proc_misc.o
> CC fs/proc/kcore.o
>
> Why did you believe it would not compile? (Just so I can be extra
> careful about this kind of code in the future.)

I was wrong. It compiles but won't work right:

a.c:
char msg[] = "boo";

b.c:
#include <stdio.h>
extern char *msg;
int main() {
puts(msg);
return 0;
}

# gcc b.c a.c
# ./a.out
Segmentation fault

--
vda

2004-11-03 21:40:42

by Vadim Lobanov

[permalink] [raw]
Subject: Re: [TRIVIAL PATCH] /init/version.c

Gotcha. Thanks.

I'll redo it correctly a bit later, with
const char msg[]; and extern char msg[];
instead of
const char * msg; and extern char * msg;

-Vadim Lobanov

On Wed, 3 Nov 2004, Denis Vlasenko wrote:

> On Wednesday 03 November 2004 18:34, vlobanov wrote:
> > It seems to compile just fine. Here are the relevant snippets:
> >
> > UPD include/asm-i386/asm_offsets.h
> > CC init/main.o
> > CHK include/linux/compile.h
> > UPD include/linux/compile.h
> > CC init/version.o
> > CC init/do_mounts.o
> >
> > ...and...
> >
> > CC fs/proc/proc_tty.o
> > CC fs/proc/proc_misc.o
> > CC fs/proc/kcore.o
> >
> > Why did you believe it would not compile? (Just so I can be extra
> > careful about this kind of code in the future.)
>
> I was wrong. It compiles but won't work right:
>
> a.c:
> char msg[] = "boo";
>
> b.c:
> #include <stdio.h>
> extern char *msg;
> int main() {
> puts(msg);
> return 0;
> }
>
> # gcc b.c a.c
> # ./a.out
> Segmentation fault
>
> --
> vda
>
>