From: Andries Brouwer <aebr@win.tue.nl>
To: tglx@linutronix.de (Thomas Gleixner)
Cc: Andries Brouwer <aebr@win.tue.nl>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.4.26] drivers/char/vt.c fix compiler warnings
Date: Mon, 17 May 2004 15:36:03 +0200 [thread overview]
Message-ID: <20040517133603.GA10913@wsdw14.win.tue.nl> (raw)
In-Reply-To: <200405171447.56737.tglx@linutronix.de>
On Mon, May 17, 2004 at 02:47:56PM +0200, Thomas Gleixner wrote:
> > (MAX_NR_KEYMAPS is a #define, often 256, on tiny systems people tend to
> > pick 16. The above test is not superfluous. MAX_NR_KEYMAPS is not an
> > absolute constant.)
>
> Ooops, did not think about that. Was just annoyed from the compiler warnings.
> What about:
>
> if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
> return -EFAULT;
> +#if MAX_NR_KEYMAPS < 256
> if (i >= NR_KEYS || s >= MAX_NR_KEYMAPS)
> +#else
> + if (i >= NR_KEYS)
> +#endif
(i) My muttering was not just about this case - also elsewhere
you removed tests that are only superfluous under a particular
constellation of #define-s.
(ii) Introducing conditional compilation certainly would not
make anybody happier.
I don't have the code nearby, but probably you could use an (unsigned) integer
variable.
Andries
next prev parent reply other threads:[~2004-05-17 13:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-15 13:05 Thomas Gleixner
2004-05-17 10:47 ` Andries Brouwer
2004-05-17 12:47 ` Thomas Gleixner
2004-05-17 13:36 ` Andries Brouwer [this message]
2004-05-17 15:40 ` Valdis.Kletnieks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040517133603.GA10913@wsdw14.win.tue.nl \
--to=aebr@win.tue.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®