From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753275AbdAKBjR (ORCPT ); Tue, 10 Jan 2017 20:39:17 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:36462 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdAKBjP (ORCPT ); Tue, 10 Jan 2017 20:39:15 -0500 Subject: [PATCH v2] staging: most: hdm-usb: Fix mismatch between types used in sizeof operator To: Greg KH References: <7b68565e-61da-cfa4-4015-623657d2ae47@gmail.com> <20170110164039.GA18418@kroah.com> Cc: christian.gromm@microchip.com, andrey.shvetsov@k2l.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org From: Eric Salem Message-ID: <46e8f637-411e-1337-797c-e2a9d6ede6f6@gmail.com> Date: Tue, 10 Jan 2017 19:38:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170110164039.GA18418@kroah.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixed mismatch between types used in sizeof operator. Signed-off-by: Eric Salem --- drivers/staging/most/hdm-usb/hdm_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index 8a6da16..01e3a31 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -145,7 +145,7 @@ static void wq_netinfo(struct work_struct *wq_obj); static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) { int retval; - __le16 *dma_buf = kzalloc(sizeof(__le16), GFP_KERNEL); + __le16 *dma_buf = kzalloc(sizeof(*dma_buf), GFP_KERNEL); u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; if (!dma_buf) @@ -154,7 +154,7 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) retval = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), DRCI_READ_REQ, req_type, 0x0000, - reg, dma_buf, sizeof(u16), 5 * HZ); + reg, dma_buf, sizeof(*dma_buf), 5 * HZ); *buf = le16_to_cpu(*dma_buf); kfree(dma_buf); -- 2.9.3 On 01/10/2017 10:40 AM, Greg KH wrote: > On Mon, Jan 09, 2017 at 09:25:56PM -0600, Eric Salem wrote: >> Fixed the following sparse warning: >> >> drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: >> cast to restricted __le16 >> >> by correcting the variable's type (also updated sizeof). >> >> Signed-off-by: Eric Salem >> Acked-by: Christian Gromm >> --- >> drivers/staging/most/hdm-usb/hdm_usb.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) > > This patch doesn't apply against linux-next, can you refresh it and > resend? > > thanks, > > greg k-h >