--- zzzz-none-000/linux-3.10.107/drivers/usb/misc/sisusbvga/sisusb.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/usb/misc/sisusbvga/sisusb.c 2021-02-04 17:41:59.000000000 +0000 @@ -2123,8 +2123,8 @@ u8 tmp8, tmp82, ramtype; int bw = 0; char *ramtypetext1 = NULL; - const char *ramtypetext2[] = { "SDR SDRAM", "SDR SGRAM", - "DDR SDRAM", "DDR SGRAM" }; + static const char ram_datarate[4] = {'S', 'S', 'D', 'D'}; + static const char ram_dynamictype[4] = {'D', 'G', 'D', 'G'}; static const int busSDR[4] = {64, 64, 128, 128}; static const int busDDR[4] = {32, 32, 64, 64}; static const int busDDRA[4] = {64+32, 64+32 , (64+32)*2, (64+32)*2}; @@ -2156,8 +2156,10 @@ break; } - dev_info(&sisusb->sisusb_dev->dev, "%dMB %s %s, bus width %d\n", (sisusb->vramsize >> 20), ramtypetext1, - ramtypetext2[ramtype], bw); + + dev_info(&sisusb->sisusb_dev->dev, "%dMB %s %cDR S%cRAM, bus width %d\n", + sisusb->vramsize >> 20, ramtypetext1, + ram_datarate[ramtype], ram_dynamictype[ramtype], bw); } static int @@ -2314,10 +2316,12 @@ /* Set mode 0x03 */ SiSUSBSetMode(sisusb->SiS_Pr, 0x03); - if (!(myfont = find_font("VGA8x16"))) + myfont = find_font("VGA8x16"); + if (!myfont) return 1; - if (!(tempbuf = vmalloc(8192))) + tempbuf = vmalloc(8192); + if (!tempbuf) return 1; for (i = 0; i < 256; i++) @@ -2340,7 +2344,8 @@ if (init && !sisusb->scrbuf) { - if ((tempbuf = vmalloc(8192))) { + tempbuf = vmalloc(8192); + if (tempbuf) { i = 4096; tempbufb = (u16 *)tempbuf; @@ -2415,11 +2420,13 @@ struct usb_interface *interface; int subminor = iminor(inode); - if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { + interface = usb_find_interface(&sisusb_driver, subminor); + if (!interface) { return -ENODEV; } - if (!(sisusb = usb_get_intfdata(interface))) { + sisusb = usb_get_intfdata(interface); + if (!sisusb) { return -ENODEV; } @@ -2470,8 +2477,7 @@ if (!sisusb) return; - if (sisusb->sisusb_dev) - usb_put_dev(sisusb->sisusb_dev); + usb_put_dev(sisusb->sisusb_dev); sisusb->sisusb_dev = NULL; sisusb_free_buffers(sisusb); @@ -2487,7 +2493,8 @@ { struct sisusb_usb_data *sisusb; - if (!(sisusb = file->private_data)) + sisusb = file->private_data; + if (!sisusb) return -ENODEV; mutex_lock(&sisusb->lock); @@ -2519,7 +2526,8 @@ u16 buf16; u32 buf32, address; - if (!(sisusb = file->private_data)) + sisusb = file->private_data; + if (!sisusb) return -ENODEV; mutex_lock(&sisusb->lock); @@ -2661,7 +2669,8 @@ u16 buf16; u32 buf32, address; - if (!(sisusb = file->private_data)) + sisusb = file->private_data; + if (!sisusb) return -ENODEV; mutex_lock(&sisusb->lock); @@ -2804,7 +2813,8 @@ struct sisusb_usb_data *sisusb; loff_t ret; - if (!(sisusb = file->private_data)) + sisusb = file->private_data; + if (!sisusb) return -ENODEV; mutex_lock(&sisusb->lock); @@ -2969,7 +2979,8 @@ long retval = 0; u32 __user *argp = (u32 __user *)arg; - if (!(sisusb = file->private_data)) + sisusb = file->private_data; + if (!sisusb) return -ENODEV; mutex_lock(&sisusb->lock); @@ -3083,7 +3094,8 @@ dev->devnum); /* Allocate memory for our private */ - if (!(sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL))) { + sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL); + if (!sisusb) { dev_err(&dev->dev, "Failed to allocate memory for private data\n"); return -ENOMEM; } @@ -3092,7 +3104,8 @@ mutex_init(&(sisusb->lock)); /* Register device */ - if ((retval = usb_register_dev(intf, &usb_sisusb_class))) { + retval = usb_register_dev(intf, &usb_sisusb_class); + if (retval) { dev_err(&sisusb->sisusb_dev->dev, "Failed to get a minor for device %d\n", dev->devnum); retval = -ENODEV; @@ -3213,7 +3226,8 @@ struct sisusb_usb_data *sisusb; /* This should *not* happen */ - if (!(sisusb = usb_get_intfdata(intf))) + sisusb = usb_get_intfdata(intf); + if (!sisusb) return; #ifdef INCL_SISUSB_CON