lkml.org 
[lkml]   [2004]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2.4.26] drivers/char/vt.c fix compiler warnings
From
Date
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]
\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.850 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site