From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Cox Date: Mon, 7 Apr 2014 10:56:48 +0100 (BST) Subject: [U-Boot] [PATCH] Fix USB keyboard polling via control endpoint In-Reply-To: <20140406111746.25D3538099A@gemini.denx.de> Message-ID: <3392231.3254.1396864604431.JavaMail.adrian@Gurnard> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > From: "Wolfgang Denk" > I agree that the code is wrong and needs fixing. data->new is an > uint8_t pointer, so taking the size of the pointer is obviously > wrong. But what you fix here is not the only place where > sizeof(data->new) is used, so this patch fixes part of the problem at > best. I can't find any other instances of sizeof in usb_kbd.c. Is this a broader problem in the USB stack? > Can you please try out if the following extended version f the patch > works and fixes your problem? You will note that I removed all > occurrences of this magic number 8 by replacing it with > USB_KBD_PDATA_SIZE so the could should also be easier to read. I've tested your extended patch, and it does fix the problem for me. I agree that adding USB_KBD_PDATA_SIZE does improve readability. Thanks and regards, Adrian Cox