Messages in this thread | | | Subject | Re: [PATCH 2.4.26] drivers/char/vt.c fix compiler warnings | From | Valdis.Kletnieks@vt ... | Date | Mon, 17 May 2004 11:40:55 -0400 |
| |
On Mon, 17 May 2004 14:47:56 +0200, Thomas Gleixner said:
> Ooops, did not think about that. Was just annoyed from the compiler warnings. > What about:
> +#if MAX_NR_KEYMAPS < 256 > if (i >= NR_KEYS || s >= MAX_NR_KEYMAPS) > +#else > + if (i >= NR_KEYS) > +#endif > return -EINVAL;
Speaking as somebody who's had stuff rejected for doing this sort of ifdef'ing, the *right* fix is to go back and look at the definitions of everything, and see if there's a reason why the compiler is tossing the warning.
Canonical example is, of course the userland:
char c; if ((c=getc()) != EOF) {....
(I don't have a 2.4 tree handy to double-check, but maybe the variable 's' should be something wider? It's *quite* possible that there is/will be some keyboard of the Chinese/Japanese/Korean persuasion which actually ends up with more than 256 keymap entries.....
[unhandled content-type:application/pgp-signature] | |