[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0707102025390.11053@fbirervta.pbzchgretzou.qr>
Date: Tue, 10 Jul 2007 20:27:51 +0200 (CEST)
From: Jan Engelhardt <jengelh@...putergmbh.de>
To: "H. Peter Anvin" <hpa@...or.com>
cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
andi@...stfloor.org, akpm@...ux-foundation.org
Subject: Re: [x86 setup 17/33] A20 handling code
On Jul 9 2007 19:51, H. Peter Anvin wrote:
>+ status = inb(0x64);
>+ if (status & 1) {
>+ /* Read and discard input data */
>+ io_delay();
>+ (void)inb(0x60);
Is the (void) cast needed for some obscure reason? Let's hope inb _is_ declared
as volatile. (Minus the volatile flames.
>+ } else if (!(status & 2)) {
>+ /* Buffers empty, finished! */
>+ return 0;
>+ }
>+ }
>+
>+ return -1;
>+}
>+
>+
>+#define A20_TEST_ADDR (4*0x80)
>+#define A20_TEST_SHORT 32
>+#define A20_TEST_LONG 2097152 /* 2^21 */
Maybe...?
#define A20_TEST_LONG (1 << 21)
>+/* Quick test to see if A20 is already enabled */
>+static int a20_test_short(void)
>+{
>+ return a20_test(A20_TEST_SHORT);
>+}
>+
>+/* Longer test that actually waits for A20 to come on line; this
>+ is useful when dealing with the KBC or other slow external circuitry. */
>+static int a20_test_long(void)
>+{
>+ return a20_test(A20_TEST_LONG);
>+}
To me looks like some of these (or other functions) could return bool.
Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists