From patchwork Sat May 30 01:48:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11579859 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 5E15C1667 for ; Sat, 30 May 2020 01:49:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 421852077D for ; Sat, 30 May 2020 01:49:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K7SaSjnZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728542AbgE3BtE (ORCPT ); Fri, 29 May 2020 21:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727876AbgE3BtD (ORCPT ); Fri, 29 May 2020 21:49:03 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E09EC03E969 for ; Fri, 29 May 2020 18:49:03 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id b28so2605433vsa.5 for ; Fri, 29 May 2020 18:49:03 -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=FMLoiEoQ3EuVCCkEbhJS/5joUb5vikA3Ups632xnwc4=; b=K7SaSjnZvABaY7Ue+w2uI3UK8YPp3wc71alyZyjLUfrptn+TZdcI6gecl45hvTv2pV mGZ7bwXC7kSFVHEkdS362utEkoyG8ejBdBa1B56qSaQ8jbu6B+ZfO+j68deYOV8hddQO 9U3rvwp8IDTcVQFLXRG/LzacokAP6fjrOcllcku+W3HbpNwbDLuKXMyJ7zYij/C7Cnpl 9GjhrgUbE5SuuULXrlAfdtMlMs6AEmhkjAugZqWQhKRXGaVHA9BjTJ5NG6QI9AURSv/7 pfjIddKzVvwEKiJ73VeN7hgwrgh/2V6LQwB4EGvUJfktmZHOBPSLIwJ6PHnXoT9mTwlc b3hA== 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=FMLoiEoQ3EuVCCkEbhJS/5joUb5vikA3Ups632xnwc4=; b=YIOxF/kKkT20JGvbPIa6VziYTDYoU3Q61LHrNtqlxQV0jAjZa/BQhLsvPA8yzJ+3me ithwuxkJCYGmWqgbhj3AExGo+20txWExPY5seD3YopCWN5ylw8AX3m9CoAPwB7phqsgD uc7R0bsBHB29ID4QDf+6DOsAXetrKNQ6yKaniSZuiNGfm/nQ8RkLGRfwcYtAcVq1OFwY VQW1gbOCDu0t1Mq2+HdiOZYQpWdQ9W26+UdmVTNfo/mOd/hLMrAwkmDwfFqeTpks+NaZ cjMj5Fz53I8cMXQztk9aJp3eeZIuIZWOCn0b1o5kEwlXQGQMQyD0ax12J6o9hyE9cdSR 1uOg== X-Gm-Message-State: AOAM533CEHF2qFcCJ+pOtsDw/PcWEBO8v9ndyHRZknhC6nykw+RU3qbG HX65IzjYGkYk7+3JCj/7vPU= X-Google-Smtp-Source: ABdhPJwWhLRMVcM0wtC+oAfzFfyLR1FBFpDnX+F6xihy2iY2SMuaGeMMMr7xpu2D8OXZSq0F/yQxdA== X-Received: by 2002:a67:fa50:: with SMTP id j16mr5089700vsq.144.1590803342389; Fri, 29 May 2020 18:49:02 -0700 (PDT) Received: from DESKTOP-2I1VNC3.localdomain (host-128-227-216-118.xlate.ufl.edu. [128.227.216.118]) by smtp.gmail.com with ESMTPSA id z75sm1507759vkd.5.2020.05.29.18.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 18:49:02 -0700 (PDT) From: Changming X-Google-Original-From: Changming To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 1/6] USB: sisusbvga: change char to u8 for sisusb_copy_memory Date: Fri, 29 May 2020 21:48:15 -0400 Message-Id: <20200530014820.9967-2-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200530014820.9967-1-liu.changm@northeastern.edu> References: <20200530014820.9967-1-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Changming Liu sisusb_copy_memory is called in several places. sisusb_copy_memory calls sisusb_write_mem_bulk which is called by sisusb_write and sisusb_send_bulk_msg. change the related parameters from char to u8 accordingly Signed-off-by: Changming Liu --- drivers/usb/misc/sisusbvga/sisusb.c | 6 +++--- drivers/usb/misc/sisusbvga/sisusb_con.c | 10 +++++----- drivers/usb/misc/sisusbvga/sisusb_init.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index fc8a5da4a07c..88c4975e303d 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -1283,7 +1283,7 @@ int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data) return sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, adr, data); } -int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, +int sisusb_copy_memory(struct sisusb_usb_data *sisusb, u8 *src, u32 dest, int length) { size_t dummy; @@ -1307,7 +1307,7 @@ static int sisusb_read_memory(struct sisusb_usb_data *sisusb, char *dest, #ifdef SISUSBENDIANTEST static void sisusb_testreadwrite(struct sisusb_usb_data *sisusb) { - static char srcbuffer[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; + static u8 srcbuffer[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; char destbuffer[10]; int i, j; @@ -2340,7 +2340,7 @@ int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init) } } else if (sisusb->scrbuf) { - ret |= sisusb_copy_memory(sisusb, (char *)sisusb->scrbuf, + ret |= sisusb_copy_memory(sisusb, (u8 *)sisusb->scrbuf, sisusb->vrambase, sisusb->scrbuf_size); } diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index cd0155310fea..85a324b658ab 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c @@ -509,7 +509,7 @@ sisusbcon_switch(struct vc_data *c) /* Restore the screen contents */ memcpy((u16 *)c->vc_origin, (u16 *)c->vc_screenbuf, length); - sisusb_copy_memory(sisusb, (char *)c->vc_origin, + sisusb_copy_memory(sisusb, (u8 *)c->vc_origin, sisusb_haddr(sisusb, c, 0, 0), length); mutex_unlock(&sisusb->lock); @@ -615,7 +615,7 @@ sisusbcon_blank(struct vc_data *c, int blank, int mode_switch) sisusbcon_memsetw((u16 *)c->vc_origin, c->vc_video_erase_char, c->vc_screenbuf_size); - sisusb_copy_memory(sisusb, (char *)c->vc_origin, + sisusb_copy_memory(sisusb, (u8 *)c->vc_origin, sisusb_haddr(sisusb, c, 0, 0), c->vc_screenbuf_size); sisusb->con_blanked = 1; @@ -897,18 +897,18 @@ sisusbcon_scroll(struct vc_data *c, unsigned int t, unsigned int b, if (copyall) sisusb_copy_memory(sisusb, - (char *)c->vc_origin, + (u8 *)c->vc_origin, sisusb_haddr(sisusb, c, 0, 0), c->vc_screenbuf_size); else if (dir == SM_UP) sisusb_copy_memory(sisusb, - (char *)c->vc_origin + c->vc_screenbuf_size - delta, + (u8 *)c->vc_origin + c->vc_screenbuf_size - delta, sisusb_haddr(sisusb, c, 0, 0) + c->vc_screenbuf_size - delta, delta); else sisusb_copy_memory(sisusb, - (char *)c->vc_origin, + (u8 *)c->vc_origin, sisusb_haddr(sisusb, c, 0, 0), delta); diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.h b/drivers/usb/misc/sisusbvga/sisusb_init.h index ace09985dae4..d0154394ba12 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.h +++ b/drivers/usb/misc/sisusbvga/sisusb_init.h @@ -828,7 +828,7 @@ extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, u32 port, void sisusb_delete(struct kref *kref); int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 * data); -int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, +int sisusb_copy_memory(struct sisusb_usb_data *sisusb, u8 *src, u32 dest, int length); int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, From patchwork Sat May 30 01:48:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11579863 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 62B5F739 for ; Sat, 30 May 2020 01:49:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 489782075A for ; Sat, 30 May 2020 01:49:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HBLyGQdR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbgE3BtE (ORCPT ); Fri, 29 May 2020 21:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728406AbgE3BtD (ORCPT ); Fri, 29 May 2020 21:49:03 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C473EC08C5C9 for ; Fri, 29 May 2020 18:49:03 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id c1so2579090vsc.11 for ; Fri, 29 May 2020 18:49:03 -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=FM110AhT0CUsBsDOPxl0m32/ZlbIZtlDutyQBecZtPo=; b=HBLyGQdRF9irSV8UwvKsfwL3qD9uga7rdMC7Xleaz+brxc9xNteBg3p+S4toQXuWgg szxSktJ8jINXSNWg8UUtFCmDc0L5w4jNuURovsl5zqWxgTzKaqiyZYoTUAyDrhA0m72P EjiRZWcetMktO/adM0KXWwJe89ZyA7kiPxSxIBdMsPM/GI3CZ1zfizIa02WS8eP0AtWx x45IzgmIrQtcpZoQxdMAf5Pddfcnl18oh4m/lJ/uwOqB35uqxK3k4XEzeDWK9Fu0NoFY zGi41p14gzJCNePD9fshU6zyZLkm99m7/GWnUaAEXwP5WlB7z/s874a86uDU6ytapin0 Gtug== 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=FM110AhT0CUsBsDOPxl0m32/ZlbIZtlDutyQBecZtPo=; b=Lx/k5fsEcKFqMCvg+NPSkt8ci0+kdOzkllWcfR5Vl83Fc7M5VLP2r84ffHKrSA4HBp aKBPFP0izoJW/4ER1tv1UcIVM01xRhX0CnyVoDFG48NwjtGlSgrIx4h3ifaO8paDQ/3Y 5oH6rhgCNHnoGllsjueLhswmSjlKcJUSCIOQFTfMiz+U1k5urL/20lNdawjc5354r3Xq ZmVcq0Ii19RU7NwGw1YIK+tb7MPTAJAqaghBDbdBqxIbPpLc89lUUP/3fFSixOzzaJc8 6ZHYqb9JMCCrkSyn2/8P1knBuITzDenDW5/Fn8CN21IS16sfqBKcqxvbX0QENkKLBsjd s+6g== X-Gm-Message-State: AOAM531xXM4eJsua7w1wGpvjpovDdPEZ1vr8NmPWK1oye3gs/8PM3Kxc kcelYgtwCrGUAb5sa3Lbfyg= X-Google-Smtp-Source: ABdhPJwzQ7XvtLv2kihTAyxoO4UJow+W4H2AGKJFevehtYnySsM79Bhou+LPgqu7YFCxYcWRQdkdsQ== X-Received: by 2002:a05:6102:109d:: with SMTP id s29mr8763579vsr.119.1590803343037; Fri, 29 May 2020 18:49:03 -0700 (PDT) Received: from DESKTOP-2I1VNC3.localdomain (host-128-227-216-118.xlate.ufl.edu. [128.227.216.118]) by smtp.gmail.com with ESMTPSA id z75sm1507759vkd.5.2020.05.29.18.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 18:49:02 -0700 (PDT) From: Changming X-Google-Original-From: Changming To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 2/6] USB: sisusbvga: change sisusb_write_mem_bulk Date: Fri, 29 May 2020 21:48:16 -0400 Message-Id: <20200530014820.9967-3-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200530014820.9967-1-liu.changm@northeastern.edu> References: <20200530014820.9967-1-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Changming Liu 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 Reported-by: kbuild test robot Reported-by: kbuild test robot Reported-by: kbuild test robot --- drivers/usb/misc/sisusbvga/sisusb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 88c4975e303d..f800a9c7feec 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 @@ -2615,7 +2615,7 @@ static ssize_t sisusb_read(struct file *file, char __user *buffer, return errno ? errno : bytes_read; } -static ssize_t sisusb_write(struct file *file, const char __user *buffer, +static ssize_t sisusb_write(struct file *file, const u8 __user *buffer, size_t count, loff_t *ppos) { struct sisusb_usb_data *sisusb; From patchwork Sat May 30 01:48:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11579865 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 C6B541667 for ; Sat, 30 May 2020 01:49:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB6902075A for ; Sat, 30 May 2020 01:49:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gFKvdlyV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728625AbgE3BtF (ORCPT ); Fri, 29 May 2020 21:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727876AbgE3BtE (ORCPT ); Fri, 29 May 2020 21:49:04 -0400 Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74AC1C03E969 for ; Fri, 29 May 2020 18:49:04 -0700 (PDT) Received: by mail-vs1-xe41.google.com with SMTP id b13so2567636vsm.13 for ; Fri, 29 May 2020 18:49:04 -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=UADLbIKSyHzQJvuYhu/QNa7UWKcQefwi+k87ECe2wSA=; b=gFKvdlyVIlYDNQoW8doLMngDj7/J7Uk/k8AUwpBF0dxYSuHTU25UmTFxasyWYSkgyQ lOl7Y4eFFZyiFEQMp8EtgkbRIVUY6hgeWrm8S2P0BYk0ZkvN7IVuGfLtcVpBkuvuHAjq W5Jf2Nt4cB+nDhGN6l0dUpupwTdFN4Rs1+t2XoVk1Av7PDg5pCZXQGs+j5qOVmfM/Oap 7gz4uCRrmQ80Ro6e5hrHhRmjp2YvEwtzEd/wpRrZ4yrNO703QBiT9mqJJp3PjvLBE6jF oeOtubcpoQx9Jv+vjZmuVHqAQh9J7PqtVv4cJxyTpSFjNENQtDmXupHmKvl9alTiqVM2 NiPg== 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=UADLbIKSyHzQJvuYhu/QNa7UWKcQefwi+k87ECe2wSA=; b=bDVlmPYOGSNWQMadKpwllfOqkXlN9LVcWsfakZUDeyfr1qVQGFDUi05HnHfIR76TVc icCMMQc/DAXvEmijPeu0lrEs9hUav34lK74LrK/6Z7a+rAKfJQvFiWTSlGVw7QFkNhJy wVuVr4yMbFJq5HypHxh0WzHRqQX90UfbrSTdSZ8vvU19X8LYRruPzY86FettDDPJsrMz JGhB4wuALM5xGWiUhPeaNrs+4FRPoNK7vQF4YIPeC3Urbaubrv8P2DiugPTB4qCMtCNN Wi/6RGdY7Kkxi5oCpQK/+sd6Nx8DUH/E3Wthbr+MFGSvGZDrVeQP7JIKBfZlMorPIojh Mx6A== X-Gm-Message-State: AOAM532rirwPMY/ezKr03oxuf8FcgqMKdb7Ev0YFDsxyijNG/of//vxv 5FwxqNIi1H4ef+96btk1B7U= X-Google-Smtp-Source: ABdhPJxra3nqy6WcfFI4bAmksxKHZbhHm6s8JlLNBlHfa4lm48b1ct4IuKGhFQNMOvSm2METvitYUg== X-Received: by 2002:a67:ecc3:: with SMTP id i3mr7616287vsp.170.1590803343723; Fri, 29 May 2020 18:49:03 -0700 (PDT) Received: from DESKTOP-2I1VNC3.localdomain (host-128-227-216-118.xlate.ufl.edu. [128.227.216.118]) by smtp.gmail.com with ESMTPSA id z75sm1507759vkd.5.2020.05.29.18.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 18:49:03 -0700 (PDT) From: Changming X-Google-Original-From: Changming To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 3/6] USB: sisusbvga: change sisusb->ibuf,obuf,font_backup Date: Fri, 29 May 2020 21:48:17 -0400 Message-Id: <20200530014820.9967-4-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200530014820.9967-1-liu.changm@northeastern.edu> References: <20200530014820.9967-1-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Changming Liu change sisusb->ibuf,obuf,font_backup to u8 and related buf 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 f800a9c7feec..83c3785ce4ab --- 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 8a5e6bb07d05..f761ede77c0b 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 Sat May 30 01:48:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11579867 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 2CE821391 for ; Sat, 30 May 2020 01:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 11C6A207F9 for ; Sat, 30 May 2020 01:49:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ye6rJSBo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgE3BtH (ORCPT ); Fri, 29 May 2020 21:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727876AbgE3BtG (ORCPT ); Fri, 29 May 2020 21:49:06 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10E6FC08C5C9 for ; Fri, 29 May 2020 18:49:05 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id 1so2581274vsl.9 for ; Fri, 29 May 2020 18:49:05 -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=xuV3GUDS4YMG1XNMIzPaZWUKlHIyzC217w53oI2G29E=; b=Ye6rJSBoaxvktib2iI4sFbjfs417oDu1RnryANrJEmCBxB1J1yGRF9WMwlUbsjFnZ+ UUH1Fef42bkaXPI2R6hE/+h94rky+WoAnrwMtAxGh0yikBcnWVW7fMVIRv8Q6c3I7wq2 G7iG1iOhQ66GKmNnzW0865aUD5M0+PMUvVpkhZA7CwkhoDc03nIPiPpWc7IYMQKO4BAK /AgnQ0+RrzPThEkjqprMUxhGXbK+lHldw0lLqr38UNB7SDS+qpHRmTDUZnG/3V1aCY9b vYHRys2slCVxAXvX34If6GE5GYildXaYxq8ijlWS6z4mBPUrNyN8PGMK/lkfA3aHXbv3 G87g== 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=xuV3GUDS4YMG1XNMIzPaZWUKlHIyzC217w53oI2G29E=; b=Yi50laOVSO2zLJmuECuEoq6b69YeYv7FKNUBPvtRa7sqoseke57yPNYe+UZeiwKCCF JwL9Fg3JMVKl3NMND2XDzVi6yK5f1L10siH0Fa06RMBjwYUwisibtR8bKZaPcBpeIQN5 3hDYDv6AM6Fq0TujAJM8oVFr3KljQplbi9VGQ47XPv4rH73xXcoHb9llE4R0Wm93l1r4 B/NhlYwOvyJlN/9do0J8ehu6jZtG2y4rZtIeBxItnEVEoHXC1ZfUwTGsMbCumLN5PiKU kgipFMVZaHrHlR10i6Koz9SrqMfT5YKiNicDfZXu4lXUKn7H9hXX2teVVWYV5AP/JUc3 nShQ== X-Gm-Message-State: AOAM530Gq+WmYp/0+RGvbbdsCnD36fsdJuqaKZZ0p68c+0EgoB8uqpZP HKmB2VuKx1NDnLtczbAdVRA= X-Google-Smtp-Source: ABdhPJwrB/4JbS0SDbaTV3R+lReDzVvH3sLM0NbFbKW56YQ/dwo7Ia435zIsAYBUc5JFtvPYSXqArw== X-Received: by 2002:a67:6958:: with SMTP id e85mr8449451vsc.194.1590803344327; Fri, 29 May 2020 18:49:04 -0700 (PDT) Received: from DESKTOP-2I1VNC3.localdomain (host-128-227-216-118.xlate.ufl.edu. [128.227.216.118]) by smtp.gmail.com with ESMTPSA id z75sm1507759vkd.5.2020.05.29.18.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 18:49:04 -0700 (PDT) From: Changming X-Google-Original-From: Changming To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 4/6] USB: sisusbvga: change userbuffer for sisusb_recv_bulk_msg to u8 Date: Fri, 29 May 2020 21:48:18 -0400 Message-Id: <20200530014820.9967-5-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200530014820.9967-1-liu.changm@northeastern.edu> References: <20200530014820.9967-1-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Changming Liu change the userbuffer of sisusb_recv_bulk_msg 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 83c3785ce4ab..9e858530c4ed 100755 --- 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 Sat May 30 01:48:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11579871 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 6A72D739 for ; Sat, 30 May 2020 01:49:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DEA42075A for ; Sat, 30 May 2020 01:49:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CbnZ8aKq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728653AbgE3BtI (ORCPT ); Fri, 29 May 2020 21:49:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728406AbgE3BtH (ORCPT ); Fri, 29 May 2020 21:49:07 -0400 Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93CBC03E969 for ; Fri, 29 May 2020 18:49:05 -0700 (PDT) Received: by mail-ua1-x942.google.com with SMTP id g14so1487560uaq.0 for ; Fri, 29 May 2020 18:49:05 -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=QyoYlbzEC2C0XCtskC7hD/a99DdKSS1XN1Xiv82FMm0=; b=CbnZ8aKqW2e4nwItjcnb6gtN2WA8tCZQLj6zgUx4vJKqYmlrCbauvL6gDXHyawETqU 8dGA5mH/DBTLkhKcoZpaGk7JEYcoYDJR7M3Tt45EoZzCIepFKQBImchaBTUfzmE8nnFL IAaa00mLlJSUOcc8NsW7rzWi1fQ6DqXwE999hQVNVyvXxpptHOLA09cpQQbszdKwaK41 hjXRi6r3jK0IkvehhjF9tJViyzwe+NubM8HZskoMWPvtTwQTt1IFoEM1XpCALX/MbdD0 RyX7PfnEof9/djGe30qONwljyyiOTil8w5NOl+7kKespQP2F37W7ieKtRMcU+MqQv+4b XwLA== 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=QyoYlbzEC2C0XCtskC7hD/a99DdKSS1XN1Xiv82FMm0=; b=h+2O41V5eomJUaXNuch9MxB+uKOahumpiNpBjcAeuz/Q45q1o+z7UpdWIZSM3e9BPY mxCPbYKtGJY+1M3zg4ZiZUhTf6C16PRxyLijf/K+IKcigO3/jNLMXZjlXJO+BNLIESvv vIr9+Ms167d7Br1pKKrY5vJHYvsQeLBAtsS0BR0zhimWeKRS4F3c24xlYNCX3G+lqFgx qlBEDMMogNy4DOxHbcEZ88BI/Kjtt0alPUUD4aDJN9Y9hb3J5bchnqynM1XBKjQJw7mo GdxvSio/ZhRyy3K3LiA1vRLxJhI5aSJXHTzKSWV7vhl8DU2WV/f+8LJgCppAALU0ZXX7 NSxw== X-Gm-Message-State: AOAM531jctOD3wBE9nlOGjL0axu/s7M9XmjTrluAvdxAJrDEMQo7bxGr 9DfB8Ydya4L2cYXWwKvYgSs= X-Google-Smtp-Source: ABdhPJyqghVrgxJFGb+CptRC+NXidd6xQjMAeOH6FmBVnbGnELSXYdE17bPXcDCY4EGXJWP794dPZg== X-Received: by 2002:ab0:490c:: with SMTP id z12mr7654882uac.33.1590803345089; Fri, 29 May 2020 18:49:05 -0700 (PDT) Received: from DESKTOP-2I1VNC3.localdomain (host-128-227-216-118.xlate.ufl.edu. [128.227.216.118]) by smtp.gmail.com with ESMTPSA id z75sm1507759vkd.5.2020.05.29.18.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 18:49:04 -0700 (PDT) From: Changming X-Google-Original-From: Changming To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 5/6] USB: sisusbvga: change sisusb_read_mem_bulk Date: Fri, 29 May 2020 21:48:19 -0400 Message-Id: <20200530014820.9967-6-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200530014820.9967-1-liu.changm@northeastern.edu> References: <20200530014820.9967-1-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Changming Liu 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 Reported-by: kbuild test robot Reported-by: kbuild test robot Reported-by: kbuild test robot --- 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 9e858530c4ed..1f21db40fdb5 100755 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -1104,11 +1104,11 @@ static int sisusb_read_memio_long(struct sisusb_usb_data *sisusb, int type, } static int sisusb_read_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, - char *kernbuffer, int length, char __user *userbuffer, + u8 *kernbuffer, int length, u8 __user *userbuffer, 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, u8 *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 u8 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); @@ -2479,7 +2479,7 @@ static int sisusb_release(struct inode *inode, struct file *file) return 0; } -static ssize_t sisusb_read(struct file *file, char __user *buffer, +static ssize_t sisusb_read(struct file *file, u8 __user *buffer, size_t count, loff_t *ppos) { struct sisusb_usb_data *sisusb; From patchwork Sat May 30 01:48:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changming X-Patchwork-Id: 11579869 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 EB4AC1391 for ; Sat, 30 May 2020 01:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D04C12075A for ; Sat, 30 May 2020 01:49:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rNZPjw7P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbgE3BtH (ORCPT ); Fri, 29 May 2020 21:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728642AbgE3BtG (ORCPT ); Fri, 29 May 2020 21:49:06 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70F4EC08C5CA for ; Fri, 29 May 2020 18:49:06 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id g7so1466932uap.7 for ; Fri, 29 May 2020 18:49:06 -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=O2zEfHJzja0FYAayQuGq1uzqD7Al76JYJxnGc3Icuto=; b=rNZPjw7PgAkEeqcGHYdoeCzQwiS/wz4pXsP5KXdoK+7S7Xog4VYFYjB9sGD4lfeS6y hC0jr3BPuI8FFq66MI4cDknFq1GPrlMeQqMJDTDqg04NVIp9BmqbrQVGuofLxgf3yym2 sQEWLs3kscB2OPed6SU7nminZdHebua9KInby0HW/HWpN9c8gKHZ52r/z6x9jmGQ8Fz6 R7dCxr+PXqIfA5HNE6K0eePPU96e4vbWdA8C7w0JaP1TErr6j4YnaZjxF5RE9TmUcrjM NZd37MkL3p6kES+ZjSCYfW2xprQLRnmEfw+ts29kiavqr2XShJdOBhPoPZgKeyeWq5C/ pH5A== 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=O2zEfHJzja0FYAayQuGq1uzqD7Al76JYJxnGc3Icuto=; b=Dt+RdNQMW3C056ZMoKQVDMbMC8LI3XQ+n0u3YaSTX15lvV2S31f0aaUi+Se2L57rDk qJ8sbMZLKSxtosrfs+pJq70LMIGrF6jdu9hFZr74Fr000V16TNq/G9me6570fOVhoJBj qqhJ/f6+0ieKyn2heqhsxVp4AS0jQt4M+iN/ujyRoHJ4O9NWBf8lTpDMDmwznFKZ5yPw uE9LQ43W3lUjN3vK6637BQUcpHwZk9A6P6Ur2bWAhyN/4Fv6GGhbyISD6QekFWAVz1ZT niw775BgnMM/74SLK7h9g5AbaScg5NjyIHQDj0x5fmxQO/aGSy2n9ItEhcubCCQoyl+z yBTQ== X-Gm-Message-State: AOAM530Xu9yNfQpylmcxyEnTORFtYaYe2C4TdY4301ktzFluZi5/Up/+ jEOVVCunbB6SHsz8As2tOgk= X-Google-Smtp-Source: ABdhPJwjZJM86D4AiJgJa0vkvRlLMEJYaxbHefnU48Vsu7lhggfV4XxJamcHb6W6JecxcDcszyQe1w== X-Received: by 2002:ab0:6e8e:: with SMTP id b14mr9765179uav.0.1590803345675; Fri, 29 May 2020 18:49:05 -0700 (PDT) Received: from DESKTOP-2I1VNC3.localdomain (host-128-227-216-118.xlate.ufl.edu. [128.227.216.118]) by smtp.gmail.com with ESMTPSA id z75sm1507759vkd.5.2020.05.29.18.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 18:49:05 -0700 (PDT) From: Changming X-Google-Original-From: Changming To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, thomas@winischhofer.net, Changming Liu Subject: [PATCH 6/6] USB: sisusbvga: change the local char array to u8 array Date: Fri, 29 May 2020 21:48:20 -0400 Message-Id: <20200530014820.9967-7-liu.changm@northeastern.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200530014820.9967-1-liu.changm@northeastern.edu> References: <20200530014820.9967-1-liu.changm@northeastern.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Changming Liu These arrays/data elements are used as unsigned. So change them from char to u8. Signed-off-by: Changming Liu --- drivers/usb/misc/sisusbvga/sisusb.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 1f21db40fdb5..70a10ad9ae0a 100755 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -1752,22 +1752,22 @@ static void sisusb_set_default_mode(struct sisusb_usb_data *sisusb, { int i, j, modex, bpp, du; u8 sr31, cr63, tmp8; - static const char attrdata[] = { + static const u8 attrdata[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x01, 0x00, 0x00, 0x00 }; - static const char crtcrdata[] = { + static const u8 crtcrdata[] = { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x8c, 0xdf, 0x28, 0x40, 0xe7, 0x04, 0xa3, 0xff }; - static const char grcdata[] = { + static const u8 grcdata[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff }; - static const char crtcdata[] = { + static const u8 crtcdata[] = { 0x5f, 0x4f, 0x4f, 0x83, 0x55, 0x81, 0x0b, 0x3e, 0xe9, 0x8b, 0xdf, 0xe8, 0x0c, 0x00, 0x00, 0x05, 0x00 @@ -1880,19 +1880,19 @@ static int sisusb_init_gfxcore(struct sisusb_usb_data *sisusb) int ret = 0, i, j, bw, chab, iret, retry = 3; u8 tmp8, ramtype; u32 tmp32; - static const char mclktable[] = { + static const u8 mclktable[] = { 0x3b, 0x22, 0x01, 143, 0x3b, 0x22, 0x01, 143, 0x3b, 0x22, 0x01, 143, 0x3b, 0x22, 0x01, 143 }; - static const char eclktable[] = { + static const u8 eclktable[] = { 0x3b, 0x22, 0x01, 143, 0x3b, 0x22, 0x01, 143, 0x3b, 0x22, 0x01, 143, 0x3b, 0x22, 0x01, 143 }; - static const char ramtypetable1[] = { + static const u8 ramtypetable1[] = { 0x00, 0x04, 0x60, 0x60, 0x0f, 0x0f, 0x1f, 0x1f, 0xba, 0xba, 0xba, 0xba, @@ -1901,7 +1901,7 @@ static int sisusb_init_gfxcore(struct sisusb_usb_data *sisusb) 0x00, 0x00, 0x02, 0x02, 0x30, 0x30, 0x40, 0x40 }; - static const char ramtypetable2[] = { + static const u8 ramtypetable2[] = { 0x77, 0x77, 0x44, 0x44, 0x77, 0x77, 0x44, 0x44, 0x00, 0x00, 0x00, 0x00,