KernelJanitor - Change applicable char *foo to char foo[]

KernelJanitor - Change applicable char *foo to char foo[]

Post by Gabriel Deveny » Tue, 06 May 2003 02:00:15



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch applies to Linux 2.5.68. It converts appropriate string declarations(those which are only read) to the memory saving char foo[] version.

http://muss.mcmaster.ca/~devenyga/linux-2.5.68-char-changes.patch

Please CC me with any discussion.
- --
Building the Future,
Gabriel Devenyi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+tvlk7I5UBdiZaF4RAnUyAJwNpcGmuWfzGjN9qVBjTF90XgKvjgCfX2pt
wcfQq8U4yIegqjoA+paMK6k=
=HF++
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

KernelJanitor - Change applicable char *foo to char foo[]

Post by Geert Uytterhoeve » Tue, 06 May 2003 10:50:07



> This patch applies to Linux 2.5.68. It converts appropriate string declarations(those which are only read) to the memory saving char foo[] version.

> http://muss.mcmaster.ca/~devenyga/linux-2.5.68-char-changes.patch

> Please CC me with any discussion.

Why don't you make all of them const while you're at it?

Gr{oetje,eeting}s,

                                                Geert

--

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. 2.4.3-ac5 - static const char *foo to static char foo[]

Hello,

  it compiles fine and there is no MAINTAINER entry for it nor specific
email address in the source file.

diff -u --recursive linux-2.4.3-ac5.orig/drivers/char/keyboard.c linux-2.4.3-ac5/drivers/char/keyboard.c
--- linux-2.4.3-ac5.orig/drivers/char/keyboard.c        Thu Apr 12 20:23:06 2001

 static void do_pad(unsigned char value, char up_flag)
 {
-       static const char *pad_chars = "0123456789+-*/\015,.?()";
-       static const char *app_map = "pqrstuvwxylSRQMnnmPQ";
+       static char pad_chars[] = "0123456789+-*/\015,.?()";
+       static char app_map[] = "pqrstuvwxylSRQMnnmPQ";

        if (up_flag)

 static void do_cur(unsigned char value, char up_flag)
 {
-       static const char *cur_chars = "BDCA";
+       static char cur_chars[] = "BDCA";
        if (up_flag)
                return;

--
Ueimor
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. DIALD, IP-MASQ and Windows machines

3. Q: file:/foo/foo.gif = /foo/foo.gif ?

4. Looking for articles on impact of cracking

5. Why ${FOO} or $(FOO) instead of just $FOO ?

6. Deleting select lines in a file?

7. Multiple variables, ie: foo=1&foo=2&foo=3

8. How do I restrict SSH to certain users

9. foo=X%XY%Z; echo ${foo//X/w} works;echo ${foo//%%/p} NotWhatIwant

10. if (foo) kfree(foo) /fs cleanup + reverted JBD code path changes

11. getting text strings into __initdata for char *foo = "data"

12. Difference between #include "foo.h" and <foo.h>

13. Make: implicit "dir/foo.o: foo.c" - how?