From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graeme Russ Date: Sat, 12 Nov 2011 21:26:56 +1100 Subject: [U-Boot] [PATCH] [x86] Fix some bugs in the i8402 driver when no controller is present In-Reply-To: <1320745694-2592-1-git-send-email-gabeblack@chromium.org> References: <1320745694-2592-1-git-send-email-gabeblack@chromium.org> Message-ID: <4EBE49F0.9040903@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Gabe, On 08/11/11 20:48, Gabe Black wrote: > If no controller is present, the i8402 driver should return immediately and > not attempt to operate on the missing hardware. > > In kbd_input_empty, the status register is checked every millisecond to see > whether the input buffer is empty, up to a timeout which is tracked by > decrimenting a counter each time the check is performed. The decrement is > performed with a postfix -- operator, and the value of the counter is > checked in place. That means that when the counter reaches zero and the > loop terminates, it will actually be decrimented one more time and become > -1. That value is returned as the return value of the function. That would > give the right answer if it wasn't for that extra decrement because a > timeout would indicate that the buffer never became empty. > > This change fixes both of those bugs. > > Signed-off-by: Gabe Black > --- > drivers/input/i8042.c | 12 +++++++++++- > 1 files changed, 11 insertions(+), 1 deletions(-) > total: 1 errors, 5 warnings, 30 lines checked Patch is not checkpatch clean - Can you please fix checkpatch issues and change tag to 'x86:' style and resubmit Thanks, Graeme