From patchwork Fri Jun 19 00:28:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11613087 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC679912 for ; Fri, 19 Jun 2020 00:29:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C319C208C7 for ; Fri, 19 Jun 2020 00:29:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CfFz9bPK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729004AbgFSA3Z (ORCPT ); Thu, 18 Jun 2020 20:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728968AbgFSA3Y (ORCPT ); Thu, 18 Jun 2020 20:29:24 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8920C06174E for ; Thu, 18 Jun 2020 17:29:22 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id e2so3687125qvw.7 for ; Thu, 18 Jun 2020 17:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6cXCGbCZwcieya022EUSgjYVX+GGTFWd1Ty+UNqIf6o=; b=CfFz9bPKofGv5v/hhRG5LEGK+Dmmuqi/t4vmnSRHugZg7OSzAh5xbxmsi67oE/C3iO jlNihyBWKzvnl36V+QQvOl0JUQebF2OLsmkQBEMTeDz4AjP4b7xMRRXwNCAQVnGvQwWG Xsr/VJ2LJ5sOxs7ckBAuooVR9p1ypoH6BvwwJIcxQ9BzG45LxUhauShJrsYOCFkmr+VA 0uP1YRPFdZwmD9XUdp13JCGPGXqfVGSLTP6RpLftCnTBpTMEOE4dice3LZbe2jCZ1orK 1MN6r4VuQiAeKJt0JvJ3ays6RRncFP+486CmaA0hc4DXkn3T5m8WNNTsxdGcYKpDVCk4 7XBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6cXCGbCZwcieya022EUSgjYVX+GGTFWd1Ty+UNqIf6o=; b=Q/eVQU4zrwy2U5oTenmV7O9yHJCCX2ZCT77312YiEyhhJP6STl5SzCPCBXUFcqCqoz EdXZPCPP/XIyl2+ZeEZp30/u2I2/FSIPxhnD3JSG2MXROoKpwVQa6UpjFifNIKFKSvPF Qx5i5IwBOeUslk8lgIRYZQ1qc5X7U4S59lt5nFvOjYNaGu3Xu+qpK3Q4e5vChQ3s4q92 rhxzoznV3HG6EdhHGrjYQavetRLMvYs36nnQX6Gp3ezGZ9pK18xHGV5E2FVB4OS10ceo guQh9ZI+f3kNwq+olHA+WxpSnFuME4ihnCWj9pz9h2RMCnZRnNm1iG4QbYBUehNTrqhs dn4w== X-Gm-Message-State: AOAM530aGaoI1Ib+D9I5hsKnaOjygCJUTSmKPWG1h7/5Kp721e6isLNd OT8ZxEdXN1kN6GNQrTsXYhI= X-Google-Smtp-Source: ABdhPJzT2yCniFFVssqW95g6XDc+G8r+Y4ZG6jGaWbkfmJW4rBlA1XSXhaWqZkBIFGGU8qPt0c/6Nw== X-Received: by 2002:ad4:4c0d:: with SMTP id bz13mr6617543qvb.164.1592526561748; Thu, 18 Jun 2020 17:29:21 -0700 (PDT) Received: from DESKTOP-JC0RTV5.neu.edu ([155.33.134.7]) by smtp.gmail.com with ESMTPSA id p7sm135497qki.61.2020.06.18.17.29.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2020 17:29:21 -0700 (PDT) From: Changming Liu X-Google-Original-From: Changming Liu To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 1/4] USB: sisusbvga: change sisusb_write_mem_bulk Date: Thu, 18 Jun 2020 20:28:51 -0400 Message-Id: <1592526534-1739-2-git-send-email-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> References: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org isusb_write_mem_bulk calls sisusb_send_bulk_msg and is called by sisusb_write. Changed their parameters accordingly. Also change the local buf[4] of sisusb_write_mem_bulk to u8. This fixed a potential undefined behavior. Signed-off-by: Changming Liu --- drivers/usb/misc/sisusbvga/sisusb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index fc8a5da..4aa717a 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -327,7 +327,7 @@ static int sisusb_bulkin_msg(struct sisusb_usb_data *sisusb, */ static int sisusb_send_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len, - char *kernbuffer, const char __user *userbuffer, int index, + u8 *kernbuffer, const u8 __user *userbuffer, int index, ssize_t *bytes_written, unsigned int tflags, int async) { int result = 0, retry, count = len; @@ -543,7 +543,7 @@ static int sisusb_send_packet(struct sisusb_usb_data *sisusb, int len, /* 1. send the packet */ ret = sisusb_send_bulk_msg(sisusb, SISUSB_EP_GFX_OUT, len, - (char *)packet, NULL, 0, &bytes_transferred, 0, 0); + (u8 *)packet, NULL, 0, &bytes_transferred, 0, 0); if ((ret == 0) && (len == 6)) { @@ -579,7 +579,7 @@ static int sisusb_send_bridge_packet(struct sisusb_usb_data *sisusb, int len, /* 1. send the packet */ ret = sisusb_send_bulk_msg(sisusb, SISUSB_EP_BRIDGE_OUT, len, - (char *)packet, NULL, 0, &bytes_transferred, tflags, 0); + (u8 *)packet, NULL, 0, &bytes_transferred, tflags, 0); if ((ret == 0) && (len == 6)) { @@ -752,7 +752,7 @@ static int sisusb_write_memio_long(struct sisusb_usb_data *sisusb, int type, */ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, - char *kernbuffer, int length, const char __user *userbuffer, + u8 *kernbuffer, int length, const u8 __user *userbuffer, int index, ssize_t *bytes_written) { struct sisusb_packet packet; @@ -761,7 +761,7 @@ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, u8 swap8, fromkern = kernbuffer ? 1 : 0; u16 swap16; u32 swap32, flag = (length >> 28) & 1; - char buf[4]; + u8 buf[4]; /* if neither kernbuffer not userbuffer are given, assume * data in obuf @@ -2700,7 +2700,7 @@ static ssize_t sisusb_write(struct file *file, const char __user *buffer, * mode or if YUV data is being transferred). */ errno = sisusb_write_mem_bulk(sisusb, address, NULL, - count, buffer, 0, &bytes_written); + count, (u8 __user *)buffer, 0, &bytes_written); if (bytes_written) errno = bytes_written; @@ -2718,7 +2718,7 @@ static ssize_t sisusb_write(struct file *file, const char __user *buffer, * in advance. */ errno = sisusb_write_mem_bulk(sisusb, address, NULL, - count, buffer, 0, &bytes_written); + count, (u8 __user *)buffer, 0, &bytes_written); if (bytes_written) errno = bytes_written; From patchwork Fri Jun 19 00:28:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11613089 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF0A590 for ; Fri, 19 Jun 2020 00:29:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4C4920888 for ; Fri, 19 Jun 2020 00:29:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s4LJ4KP9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729016AbgFSA3Z (ORCPT ); Thu, 18 Jun 2020 20:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727981AbgFSA3Y (ORCPT ); Thu, 18 Jun 2020 20:29:24 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2931AC0613EE for ; Thu, 18 Jun 2020 17:29:23 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id fc4so3707629qvb.1 for ; Thu, 18 Jun 2020 17:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mq029+n0AUpV9BXDfINhsGOCpowi8sNUtFRbjDoZJ2A=; b=s4LJ4KP97rBA7QaEY0WZSHVj6JtZvhBpoJ6pk1020SWCjdbkx0kViUf4f22knpAF9n zYlte2t9QQTSBTvjUQD05EqvNg3IAU9ve8gQbkEEAQzx0lG+17d7OIWXnEyOeIVO4QHP zf4vtbKLp0iMnCvFBxkCmNlGmHCXkApuTWL2C7EzIdNFYXqxdBbFKRkJtplmqe7yqHWs zE+q+zwiyEDM7Kn8dvOSczZ71R4aUSNbC06/hP8039Vutsw+qkXKAu3QOsn5OJzLF2SE hDYRpPiSzf/p+ok7ymlbLKfeYMldKvEBDAp0f+B78Cu0Mh1f5u4rsbZq+Onh2jflgZEj PLNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Mq029+n0AUpV9BXDfINhsGOCpowi8sNUtFRbjDoZJ2A=; b=Dl7zvFFbGDfFmWkWtBGdqA8NrLZ+KhslK2Mbe/ube7zBQ1OTVyvtqIZw4VcEo2VtUd qmYpYUXN/jYs1/92l1sY7UR5Xg2OATYuOpi9yZW0AdHIGc7dzEbBSsvBHYemK8fefh4g qaYgjqYHhFMbyyeYhxxhMqTikuLLW5/cZjHmc+AvMpMP+GK8vmPh02HFOBMEk5XLTBQB 0uccoLDiKp6cHaVRwqWsbt9O/xSHQKxRY4prp/PqrcJLJZlOi6Tw34GKPI+7d+8exSKU z3IPJ0MSvNBn00pcGWd/LG9zf20sX9MDsg/QR1dIGNqdKAvqT22rvIetacu+r+8Q4PMV GOSg== X-Gm-Message-State: AOAM531MWgLwsN4W8iquQP8QJ9QRvcIjr/j6/WJs+/SrgYZYiFcs6Ql7 oIAlXvAnfVjR1s0njt8/AmU= X-Google-Smtp-Source: ABdhPJziYglSw1CSc6oCh8JXuQfkxCbCpfwImHD73kFB/ZFWtdyCFJs1MkbCNmEbcfGU2xyb5XLFOQ== X-Received: by 2002:ad4:4374:: with SMTP id u20mr6475370qvt.144.1592526562390; Thu, 18 Jun 2020 17:29:22 -0700 (PDT) Received: from DESKTOP-JC0RTV5.neu.edu ([155.33.134.7]) by smtp.gmail.com with ESMTPSA id p7sm135497qki.61.2020.06.18.17.29.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2020 17:29:22 -0700 (PDT) From: Changming Liu X-Google-Original-From: Changming Liu To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 2/4] USB: sisusbvga: change the buffers of sisusb from char to u8 Date: Thu, 18 Jun 2020 20:28:52 -0400 Message-Id: <1592526534-1739-3-git-send-email-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> References: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org change the buffer of sisusb namely, ibuf,obuf, font_backup from char* to unsigned char*. Also change the related buffer which can be assigned to them Signed-off-by: Changming Liu --- drivers/usb/misc/sisusbvga/sisusb.c | 4 ++-- drivers/usb/misc/sisusbvga/sisusb.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 4aa717a..8878c28 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -335,7 +335,7 @@ static int sisusb_send_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len, int fromuser = (userbuffer != NULL) ? 1 : 0; int fromkern = (kernbuffer != NULL) ? 1 : 0; unsigned int pipe; - char *buffer; + u8 *buffer; (*bytes_written) = 0; @@ -454,7 +454,7 @@ static int sisusb_recv_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len, int result = 0, retry, count = len; int bufsize, thispass, transferred_len; unsigned int pipe; - char *buffer; + u8 *buffer; (*bytes_read) = 0; diff --git a/drivers/usb/misc/sisusbvga/sisusb.h b/drivers/usb/misc/sisusbvga/sisusb.h index c0fb9e1..8fe5d07 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.h +++ b/drivers/usb/misc/sisusbvga/sisusb.h @@ -109,7 +109,7 @@ struct sisusb_usb_data { int present; /* !=0 if device is present on the bus */ int ready; /* !=0 if device is ready for userland */ int numobufs; /* number of obufs = number of out urbs */ - char *obuf[NUMOBUFS], *ibuf; /* transfer buffers */ + unsigned char *obuf[NUMOBUFS], *ibuf; /* transfer buffers */ int obufsize, ibufsize; struct urb *sisurbout[NUMOBUFS]; struct urb *sisurbin; @@ -140,7 +140,7 @@ struct sisusb_usb_data { int sisusb_cursor_size_to; int current_font_height, current_font_512; int font_backup_size, font_backup_height, font_backup_512; - char *font_backup; + unsigned char *font_backup; int font_slot; struct vc_data *sisusb_display_fg; int is_gfx; From patchwork Fri Jun 19 00:28:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11613085 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 560E490 for ; Fri, 19 Jun 2020 00:29:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DBC120888 for ; Fri, 19 Jun 2020 00:29:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kf86HnGv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728989AbgFSA3Y (ORCPT ); Thu, 18 Jun 2020 20:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727981AbgFSA3X (ORCPT ); Thu, 18 Jun 2020 20:29:23 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADEB9C0613EF for ; Thu, 18 Jun 2020 17:29:23 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id fc4so3707639qvb.1 for ; Thu, 18 Jun 2020 17:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zey5/HEMnczIhTbkvBUGfCn+Fd1KG+Z57tf47eFAyUg=; b=Kf86HnGvbnkVjhEM3n+lfUEgFr/8LXPo/pUbCoc9NnkO6Preg3evv9KC3qzY5tSGp1 cd21BHMqT1BSbKXvoX1Og6rcwe6i6g9Y1nB5QLewGtM/q2LLlv7QnOrHz8Fi2lr2x5OU 3hZd9NZdxfzdy79xmRyQSj1/adJS8AzS+CnWMusvPU5sXO/4/OcfIeesXavdMzKvMAg0 BT/nlSCrbKLQ6CWXXzWgsiv151uVoIxZMmcqpVOTLaWjYwsVYYLS6fkdLIe5pccZdNSx Lb2cmkIFlxHfb+NA7W60rKRy+qZy8kk+M4VXnD2aISfIWCUNqlphZjKA5XysTkcAQFq8 UBSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zey5/HEMnczIhTbkvBUGfCn+Fd1KG+Z57tf47eFAyUg=; b=JfVhhx6Ak1w0LdwLFAVaL7LY636E+0/v5fuZMHXxFn7vSoYBdeVReLdkuodXRa+QxK 64/xKw70AIxpzL8VLIet5EpsUw77EvHaC5CrukZO1Y13W5BCuTL3wuBPJsIEfe0G34LT 5NdyVjv90gHzqwNp5dKRzhNwq9zM2slwegPzJRNHxWDjNjBiZMLiADRos4bChSJyA1UI +IGloDkv9nGN9Cl/9eo08oBtLeBGKKLfOyTH7usGXp3GXNtoyEfF7S1/dlNgdvnqV1bS GRSDkLEwL71rKSjDssW2JVBfFUNewmPMS/x61SNSbnsupf9ux6vAdY0exm8h6jQaM+XL sFKg== X-Gm-Message-State: AOAM531j4sMDtNdNEMhiKGLxtSXKd1f8QQXFicOWgyS/Sm2h3R6athnK 4/gYne4HPR2STL7gR8elPTU= X-Google-Smtp-Source: ABdhPJxhFhKB4ZBiavyyY8YWxtj7H6H8aRk7LVLxz5yd6zQhViiZ05aBEnd7EbVs8+VkN4qbsogVyw== X-Received: by 2002:ad4:42b1:: with SMTP id e17mr6555166qvr.104.1592526563011; Thu, 18 Jun 2020 17:29:23 -0700 (PDT) Received: from DESKTOP-JC0RTV5.neu.edu ([155.33.134.7]) by smtp.gmail.com with ESMTPSA id p7sm135497qki.61.2020.06.18.17.29.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2020 17:29:22 -0700 (PDT) From: Changming Liu X-Google-Original-From: Changming Liu To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 3/4] USB: sisusbvga: change userbuffer for sisusb_recv_bulk_msg to u8 Date: Thu, 18 Jun 2020 20:28:53 -0400 Message-Id: <1592526534-1739-4-git-send-email-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> References: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org change the userbuffer of sisusb_recv_bulk_msg from char to u8 also force cast the kernbuffer to u8 when passed in Signed-off-by: Changming Liu --- drivers/usb/misc/sisusbvga/sisusb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 8878c28..86638c1 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -448,7 +448,7 @@ static int sisusb_send_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len, */ static int sisusb_recv_bulk_msg(struct sisusb_usb_data *sisusb, int ep, int len, - void *kernbuffer, char __user *userbuffer, ssize_t *bytes_read, + void *kernbuffer, u8 __user *userbuffer, ssize_t *bytes_read, unsigned int tflags) { int result = 0, retry, count = len; @@ -551,7 +551,7 @@ static int sisusb_send_packet(struct sisusb_usb_data *sisusb, int len, * return value and write it to packet->data */ ret = sisusb_recv_bulk_msg(sisusb, SISUSB_EP_GFX_IN, 4, - (char *)&tmp, NULL, &bytes_transferred, 0); + (u8 *)&tmp, NULL, &bytes_transferred, 0); packet->data = le32_to_cpu(tmp); } @@ -587,7 +587,7 @@ static int sisusb_send_bridge_packet(struct sisusb_usb_data *sisusb, int len, * return value and write it to packet->data */ ret = sisusb_recv_bulk_msg(sisusb, SISUSB_EP_BRIDGE_IN, 4, - (char *)&tmp, NULL, &bytes_transferred, 0); + (u8 *)&tmp, NULL, &bytes_transferred, 0); packet->data = le32_to_cpu(tmp); } From patchwork Fri Jun 19 00:28:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11613091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB7C190 for ; Fri, 19 Jun 2020 00:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B368D208B8 for ; Fri, 19 Jun 2020 00:29:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DTEkaGtc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729065AbgFSA31 (ORCPT ); Thu, 18 Jun 2020 20:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727981AbgFSA3Z (ORCPT ); Thu, 18 Jun 2020 20:29:25 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 859AFC0613EF for ; Thu, 18 Jun 2020 17:29:24 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id u17so6031372qtq.1 for ; Thu, 18 Jun 2020 17:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UTbqhOEYS29FJC4rPhCQFI5w6/Y0lWfaAuogwssHtfc=; b=DTEkaGtc6R6fGJr7rRShCRO38K/8M8Zvu5FF/CGfQMiA6ORSgnmEsOIleO7QVXFeJf g9Tp1yCSbPTzCN31yHNMuHHCDI6rmnn4j4H2o7I89HuPatFor6NzuRqseOceM3mBO5rz gB3dE6AxRXvQHUHClJtDTPRqfEzaq3N6D971YDBbqveBoMRoeSp7fNnHhbUOi1zGCR6i c6ZJ1Zx+hVZBU2B+5nOU3k8VqGiTg43Znrypuk974BVDa1cwvY0iE8d2vNgQyyYYngYQ KWSTpVVqoR26WyPki+q+RfQIe0E3aonDv9RNn1NpaUku9tWQnaJ8LdbxJdysWTWzLJIh 8uOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UTbqhOEYS29FJC4rPhCQFI5w6/Y0lWfaAuogwssHtfc=; b=KA2vmJ5Z33KENkSZV0MXxUGZRjLyJMzKKvDiiehNhLo8ODDNIWV89mch0Yk7bOdOjI L6gXdaaiKFYlZyo7PuZA1Zp1f/82IWPPm0mAObAVZ9ZV/jKxd8du3GVSl0c1U7WREEx0 atle6vQW8+rgAuQjK5S7taEGBsjVTQy+mjlV3HbzXRCHqduiCPSyS6vaEsvDBqrYTcWl KudqiWKUfNBOAl3DwmEgDSbU74AiR9GhYRGtMzI3WnBkU8G89OJIq+rcx2bG8QYGfVFL qx4PkSpcpIM86i4il0nzq1Q0x9U9SMbVuClRFBnPPwwCvz4zo4E7OwZX/k5B+iiVs/rN WFIA== X-Gm-Message-State: AOAM5333cmf3e3Ujco/Kf409BupeuzX/PhdOuco0U6bKfVGiJuGMphGA k8gxhdvI+5FmgshSKWRpZGNl2Slj X-Google-Smtp-Source: ABdhPJziyMq2XPdRIr/IxtN4JCxA8FNNgeeGzjZECX7DYTzWpReZduInFvdIQ5pIWB19Ffm46BFmqA== X-Received: by 2002:ac8:548b:: with SMTP id h11mr1038518qtq.66.1592526563821; Thu, 18 Jun 2020 17:29:23 -0700 (PDT) Received: from DESKTOP-JC0RTV5.neu.edu ([155.33.134.7]) by smtp.gmail.com with ESMTPSA id p7sm135497qki.61.2020.06.18.17.29.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2020 17:29:23 -0700 (PDT) From: Changming Liu X-Google-Original-From: Changming Liu To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 4/4] USB: sisusbvga: change sisusb_read_mem_bulk Date: Thu, 18 Jun 2020 20:28:54 -0400 Message-Id: <1592526534-1739-5-git-send-email-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> References: <1592526534-1739-1-git-send-email-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org change sisusb_read_mem_bulk userbuffer,kernbuffer and local buf from char to u8. Also it's called by sisusb_read_memory sisusb_testreadwrite and sisusb_read. Change their parameter types accordingly. Signed-off-by: Changming Liu --- drivers/usb/misc/sisusbvga/sisusb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 86638c1..f1b46b5 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -1108,7 +1108,7 @@ static int sisusb_read_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, ssize_t *bytes_read) { int ret = 0; - char buf[4]; + u8 buf[4]; u16 swap16; u32 swap32; @@ -1293,7 +1293,7 @@ int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, } #ifdef SISUSBENDIANTEST -static int sisusb_read_memory(struct sisusb_usb_data *sisusb, char *dest, +static int sisusb_read_memory(struct sisusb_usb_data *sisusb, u8 *dest, u32 src, int length) { size_t dummy; @@ -1308,7 +1308,7 @@ static int sisusb_read_memory(struct sisusb_usb_data *sisusb, char *dest, static void sisusb_testreadwrite(struct sisusb_usb_data *sisusb) { static char srcbuffer[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; - char destbuffer[10]; + u8 destbuffer[10]; int i, j; sisusb_copy_memory(sisusb, srcbuffer, sisusb->vrambase, 7); @@ -2561,7 +2561,7 @@ static ssize_t sisusb_read(struct file *file, char __user *buffer, * Remember: Data delivered is never endian-corrected */ errno = sisusb_read_mem_bulk(sisusb, address, - NULL, count, buffer, &bytes_read); + NULL, count, (u8 __user *)buffer, &bytes_read); if (bytes_read) errno = bytes_read; @@ -2577,7 +2577,7 @@ static ssize_t sisusb_read(struct file *file, char __user *buffer, * Remember: Data delivered is never endian-corrected */ errno = sisusb_read_mem_bulk(sisusb, address, - NULL, count, buffer, &bytes_read); + NULL, count, (u8 __user *)buffer, &bytes_read); if (bytes_read) errno = bytes_read;