diff mbox series

[2/6] USB: sisusbvga: change sisusb_write_mem_bulk

Message ID 20200530014820.9967-3-liu.changm@northeastern.edu (mailing list archive)
State New, archived
Headers show
Series [1/6] USB: sisusbvga: change char to u8 for sisusb_copy_memory | expand

Commit Message

Changming May 30, 2020, 1:48 a.m. UTC
From: Changming Liu <liu.changm@northeastern.edu>

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 <liu.changm@northeastern.edu>
---
 drivers/usb/misc/sisusbvga/sisusb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

kernel test robot May 31, 2020, 9:14 p.m. UTC | #1
Hi Changming,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on balbi-usb/testing/next peter.chen-usb/ci-for-usb-next v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Changming/USB-sisusbvga-series-of-changes-char-to-u8/20200601-012438
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/usb/misc/sisusbvga/sisusb.c:2997:11: error: initialization of 'ssize_t (*)(struct file *, const char *, size_t,  loff_t *)' {aka 'long int (*)(struct file *, const char *, long unsigned int,  long long int *)'} from incompatible pointer type 'ssize_t (*)(struct file *, const u8 *, size_t,  loff_t *)' {aka 'long int (*)(struct file *, const unsigned char *, long unsigned int,  long long int *)'} [-Werror=incompatible-pointer-types]
2997 |  .write = sisusb_write,
|           ^~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb.c:2997:11: note: (near initialization for 'usb_sisusb_fops.write')
In file included from drivers/usb/misc/sisusbvga/sisusb.c:54:
drivers/usb/misc/sisusbvga/sisusb_init.h:695:34: warning: 'SiSUSB_VCLKData' defined but not used [-Wunused-const-variable=]
695 | static const struct SiS_VCLKData SiSUSB_VCLKData[] = {
|                                  ^~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:437:35: warning: 'SiSUSB_CRT1Table' defined but not used [-Wunused-const-variable=]
437 | static const struct SiS_CRT1Table SiSUSB_CRT1Table[] = {
|                                   ^~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:379:30: warning: 'SiSUSB_RefIndex' defined but not used [-Wunused-const-variable=]
379 | static const struct SiS_Ext2 SiSUSB_RefIndex[] = {
|                              ^~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:300:29: warning: 'SiSUSB_EModeIDTable' defined but not used [-Wunused-const-variable=]
300 | static const struct SiS_Ext SiSUSB_EModeIDTable[] = {
|                             ^~~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:269:36: warning: 'SiSUSB_StandTable' defined but not used [-Wunused-const-variable=]
269 | static const struct SiS_StandTable SiSUSB_StandTable[] = {
|                                    ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:232:37: warning: 'SiSUSB_ModeResInfo' defined but not used [-Wunused-const-variable=]
232 | static const struct SiS_ModeResInfo SiSUSB_ModeResInfo[] = {
|                                     ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:224:37: warning: 'SiSUSB_StResInfo' defined but not used [-Wunused-const-variable=]
224 | static const struct SiS_StResInfo_S SiSUSB_StResInfo[] = {
|                                     ^~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:219:28: warning: 'SiSUSB_SModeIDTable' defined but not used [-Wunused-const-variable=]
219 | static const struct SiS_St SiSUSB_SModeIDTable[] = {
|                            ^~~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:206:28: warning: 'SiS_VGA_DAC' defined but not used [-Wunused-const-variable=]
206 | static const unsigned char SiS_VGA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:195:28: warning: 'SiS_EGA_DAC' defined but not used [-Wunused-const-variable=]
195 | static const unsigned char SiS_EGA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:184:28: warning: 'SiS_CGA_DAC' defined but not used [-Wunused-const-variable=]
184 | static const unsigned char SiS_CGA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:173:28: warning: 'SiS_MDA_DAC' defined but not used [-Wunused-const-variable=]
173 | static const unsigned char SiS_MDA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:171:29: warning: 'ModeIndex_1280x1024' defined but not used [-Wunused-const-variable=]
171 | static const unsigned short ModeIndex_1280x1024[] = { 0x3a, 0x4d, 0x00, 0x65 };
|                             ^~~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:170:29: warning: 'ModeIndex_1280x768' defined but not used [-Wunused-const-variable=]
170 | static const unsigned short ModeIndex_1280x768[] = { 0x23, 0x24, 0x00, 0x25 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:169:29: warning: 'ModeIndex_1280x720' defined but not used [-Wunused-const-variable=]
169 | static const unsigned short ModeIndex_1280x720[] = { 0x79, 0x75, 0x00, 0x78 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:168:29: warning: 'ModeIndex_1152x864' defined but not used [-Wunused-const-variable=]
168 | static const unsigned short ModeIndex_1152x864[] = { 0x29, 0x2a, 0x00, 0x2b };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:167:29: warning: 'ModeIndex_1024x576' defined but not used [-Wunused-const-variable=]
167 | static const unsigned short ModeIndex_1024x576[] = { 0x71, 0x74, 0x00, 0x77 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:166:29: warning: 'ModeIndex_1024x768' defined but not used [-Wunused-const-variable=]
166 | static const unsigned short ModeIndex_1024x768[] = { 0x38, 0x4a, 0x00, 0x64 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:165:29: warning: 'ModeIndex_960x600' defined but not used [-Wunused-const-variable=]
165 | static const unsigned short ModeIndex_960x600[] = { 0x20, 0x21, 0x00, 0x22 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:164:29: warning: 'ModeIndex_960x540' defined but not used [-Wunused-const-variable=]
164 | static const unsigned short ModeIndex_960x540[] = { 0x1d, 0x1e, 0x00, 0x1f };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:163:29: warning: 'ModeIndex_856x480' defined but not used [-Wunused-const-variable=]
163 | static const unsigned short ModeIndex_856x480[] = { 0x3f, 0x42, 0x00, 0x45 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:162:29: warning: 'ModeIndex_848x480' defined but not used [-Wunused-const-variable=]
162 | static const unsigned short ModeIndex_848x480[] = { 0x39, 0x3b, 0x00, 0x3e };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:161:29: warning: 'ModeIndex_800x600' defined but not used [-Wunused-const-variable=]
161 | static const unsigned short ModeIndex_800x600[] = { 0x30, 0x47, 0x00, 0x63 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:160:29: warning: 'ModeIndex_800x480' defined but not used [-Wunused-const-variable=]
160 | static const unsigned short ModeIndex_800x480[] = { 0x70, 0x7a, 0x00, 0x76 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:159:29: warning: 'ModeIndex_768x576' defined but not used [-Wunused-const-variable=]
159 | static const unsigned short ModeIndex_768x576[] = { 0x5f, 0x60, 0x00, 0x61 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:158:29: warning: 'ModeIndex_720x576' defined but not used [-Wunused-const-variable=]
158 | static const unsigned short ModeIndex_720x576[] = { 0x32, 0x34, 0x00, 0x36 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:157:29: warning: 'ModeIndex_720x480' defined but not used [-Wunused-const-variable=]
157 | static const unsigned short ModeIndex_720x480[] = { 0x31, 0x33, 0x00, 0x35 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:156:29: warning: 'ModeIndex_640x480' defined but not used [-Wunused-const-variable=]
156 | static const unsigned short ModeIndex_640x480[] = { 0x2e, 0x44, 0x00, 0x62 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:155:29: warning: 'ModeIndex_640x400' defined but not used [-Wunused-const-variable=]
155 | static const unsigned short ModeIndex_640x400[] = { 0x2f, 0x5d, 0x00, 0x5e };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:154:29: warning: 'ModeIndex_512x384' defined but not used [-Wunused-const-variable=]
154 | static const unsigned short ModeIndex_512x384[] = { 0x52, 0x58, 0x00, 0x5c };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:153:29: warning: 'ModeIndex_400x300' defined but not used [-Wunused-const-variable=]
153 | static const unsigned short ModeIndex_400x300[] = { 0x51, 0x57, 0x00, 0x54 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:152:29: warning: 'ModeIndex_320x240' defined but not used [-Wunused-const-variable=]
152 | static const unsigned short ModeIndex_320x240[] = { 0x50, 0x56, 0x00, 0x53 };
|                             ^~~~~~~~~~~~~~~~~

vim +2997 drivers/usb/misc/sisusbvga/sisusb.c

^1da177e4c3f41 Linus Torvalds              2005-04-16  2991  
066202dd48cf32 Luiz Fernando N. Capitulino 2006-08-05  2992  static const struct file_operations usb_sisusb_fops = {
^1da177e4c3f41 Linus Torvalds              2005-04-16  2993  	.owner =	THIS_MODULE,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2994  	.open =		sisusb_open,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2995  	.release =	sisusb_release,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2996  	.read =		sisusb_read,
^1da177e4c3f41 Linus Torvalds              2005-04-16 @2997  	.write =	sisusb_write,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2998  	.llseek =	sisusb_lseek,
022e468e139573 Jiri Slaby                  2019-01-22  2999  #ifdef CONFIG_COMPAT
^1da177e4c3f41 Linus Torvalds              2005-04-16  3000  	.compat_ioctl = sisusb_compat_ioctl,
^1da177e4c3f41 Linus Torvalds              2005-04-16  3001  #endif
49f15255465321 Alan Cox                    2008-05-22  3002  	.unlocked_ioctl = sisusb_ioctl
^1da177e4c3f41 Linus Torvalds              2005-04-16  3003  };
^1da177e4c3f41 Linus Torvalds              2005-04-16  3004  

:::::: The code at line 2997 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot May 31, 2020, 9:35 p.m. UTC | #2
Hi Changming,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on balbi-usb/testing/next v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Changming/USB-sisusbvga-series-of-changes-char-to-u8/20200601-012438
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2388a096e7865c043e83ece4e26654bd3d1a20d5)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/usb/misc/sisusbvga/sisusb.c:2997:11: error: incompatible function pointer types initializing 'ssize_t (*)(struct file *, const char *, size_t, loff_t *)' (aka 'long (*)(struct file *, const char *, unsigned long, long long *)') with an expression of type 'ssize_t (struct file *, const u8 *, size_t, loff_t *)' (aka 'long (struct file *, const unsigned char *, unsigned long, long long *)') [-Werror,-Wincompatible-function-pointer-types]
.write =        sisusb_write,
^~~~~~~~~~~~
1 error generated.

vim +2997 drivers/usb/misc/sisusbvga/sisusb.c

^1da177e4c3f41 Linus Torvalds              2005-04-16  2991  
066202dd48cf32 Luiz Fernando N. Capitulino 2006-08-05  2992  static const struct file_operations usb_sisusb_fops = {
^1da177e4c3f41 Linus Torvalds              2005-04-16  2993  	.owner =	THIS_MODULE,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2994  	.open =		sisusb_open,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2995  	.release =	sisusb_release,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2996  	.read =		sisusb_read,
^1da177e4c3f41 Linus Torvalds              2005-04-16 @2997  	.write =	sisusb_write,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2998  	.llseek =	sisusb_lseek,
022e468e139573 Jiri Slaby                  2019-01-22  2999  #ifdef CONFIG_COMPAT
^1da177e4c3f41 Linus Torvalds              2005-04-16  3000  	.compat_ioctl = sisusb_compat_ioctl,
^1da177e4c3f41 Linus Torvalds              2005-04-16  3001  #endif
49f15255465321 Alan Cox                    2008-05-22  3002  	.unlocked_ioctl = sisusb_ioctl
^1da177e4c3f41 Linus Torvalds              2005-04-16  3003  };
^1da177e4c3f41 Linus Torvalds              2005-04-16  3004  

:::::: The code at line 2997 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot May 31, 2020, 9:37 p.m. UTC | #3
Hi Changming,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on balbi-usb/testing/next peter.chen-usb/ci-for-usb-next v5.7-rc7 next-20200529]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Changming/USB-sisusbvga-series-of-changes-char-to-u8/20200601-012438
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/usb/misc/sisusbvga/sisusb.c:2997:11: error: initialization of 'ssize_t (*)(struct file *, const char *, size_t,  loff_t *)' {aka 'int (*)(struct file *, const char *, unsigned int,  long long int *)'} from incompatible pointer type 'ssize_t (*)(struct file *, const u8 *, size_t,  loff_t *)' {aka 'int (*)(struct file *, const unsigned char *, unsigned int,  long long int *)'} [-Werror=incompatible-pointer-types]
2997 |  .write = sisusb_write,
|           ^~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb.c:2997:11: note: (near initialization for 'usb_sisusb_fops.write')
In file included from drivers/usb/misc/sisusbvga/sisusb.c:54:
drivers/usb/misc/sisusbvga/sisusb_init.h:695:34: warning: 'SiSUSB_VCLKData' defined but not used [-Wunused-const-variable=]
695 | static const struct SiS_VCLKData SiSUSB_VCLKData[] = {
|                                  ^~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:437:35: warning: 'SiSUSB_CRT1Table' defined but not used [-Wunused-const-variable=]
437 | static const struct SiS_CRT1Table SiSUSB_CRT1Table[] = {
|                                   ^~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:379:30: warning: 'SiSUSB_RefIndex' defined but not used [-Wunused-const-variable=]
379 | static const struct SiS_Ext2 SiSUSB_RefIndex[] = {
|                              ^~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:300:29: warning: 'SiSUSB_EModeIDTable' defined but not used [-Wunused-const-variable=]
300 | static const struct SiS_Ext SiSUSB_EModeIDTable[] = {
|                             ^~~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:269:36: warning: 'SiSUSB_StandTable' defined but not used [-Wunused-const-variable=]
269 | static const struct SiS_StandTable SiSUSB_StandTable[] = {
|                                    ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:232:37: warning: 'SiSUSB_ModeResInfo' defined but not used [-Wunused-const-variable=]
232 | static const struct SiS_ModeResInfo SiSUSB_ModeResInfo[] = {
|                                     ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:224:37: warning: 'SiSUSB_StResInfo' defined but not used [-Wunused-const-variable=]
224 | static const struct SiS_StResInfo_S SiSUSB_StResInfo[] = {
|                                     ^~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:219:28: warning: 'SiSUSB_SModeIDTable' defined but not used [-Wunused-const-variable=]
219 | static const struct SiS_St SiSUSB_SModeIDTable[] = {
|                            ^~~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:206:28: warning: 'SiS_VGA_DAC' defined but not used [-Wunused-const-variable=]
206 | static const unsigned char SiS_VGA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:195:28: warning: 'SiS_EGA_DAC' defined but not used [-Wunused-const-variable=]
195 | static const unsigned char SiS_EGA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:184:28: warning: 'SiS_CGA_DAC' defined but not used [-Wunused-const-variable=]
184 | static const unsigned char SiS_CGA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:173:28: warning: 'SiS_MDA_DAC' defined but not used [-Wunused-const-variable=]
173 | static const unsigned char SiS_MDA_DAC[] = {
|                            ^~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:171:29: warning: 'ModeIndex_1280x1024' defined but not used [-Wunused-const-variable=]
171 | static const unsigned short ModeIndex_1280x1024[] = { 0x3a, 0x4d, 0x00, 0x65 };
|                             ^~~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:170:29: warning: 'ModeIndex_1280x768' defined but not used [-Wunused-const-variable=]
170 | static const unsigned short ModeIndex_1280x768[] = { 0x23, 0x24, 0x00, 0x25 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:169:29: warning: 'ModeIndex_1280x720' defined but not used [-Wunused-const-variable=]
169 | static const unsigned short ModeIndex_1280x720[] = { 0x79, 0x75, 0x00, 0x78 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:168:29: warning: 'ModeIndex_1152x864' defined but not used [-Wunused-const-variable=]
168 | static const unsigned short ModeIndex_1152x864[] = { 0x29, 0x2a, 0x00, 0x2b };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:167:29: warning: 'ModeIndex_1024x576' defined but not used [-Wunused-const-variable=]
167 | static const unsigned short ModeIndex_1024x576[] = { 0x71, 0x74, 0x00, 0x77 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:166:29: warning: 'ModeIndex_1024x768' defined but not used [-Wunused-const-variable=]
166 | static const unsigned short ModeIndex_1024x768[] = { 0x38, 0x4a, 0x00, 0x64 };
|                             ^~~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:165:29: warning: 'ModeIndex_960x600' defined but not used [-Wunused-const-variable=]
165 | static const unsigned short ModeIndex_960x600[] = { 0x20, 0x21, 0x00, 0x22 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:164:29: warning: 'ModeIndex_960x540' defined but not used [-Wunused-const-variable=]
164 | static const unsigned short ModeIndex_960x540[] = { 0x1d, 0x1e, 0x00, 0x1f };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:163:29: warning: 'ModeIndex_856x480' defined but not used [-Wunused-const-variable=]
163 | static const unsigned short ModeIndex_856x480[] = { 0x3f, 0x42, 0x00, 0x45 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:162:29: warning: 'ModeIndex_848x480' defined but not used [-Wunused-const-variable=]
162 | static const unsigned short ModeIndex_848x480[] = { 0x39, 0x3b, 0x00, 0x3e };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:161:29: warning: 'ModeIndex_800x600' defined but not used [-Wunused-const-variable=]
161 | static const unsigned short ModeIndex_800x600[] = { 0x30, 0x47, 0x00, 0x63 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:160:29: warning: 'ModeIndex_800x480' defined but not used [-Wunused-const-variable=]
160 | static const unsigned short ModeIndex_800x480[] = { 0x70, 0x7a, 0x00, 0x76 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:159:29: warning: 'ModeIndex_768x576' defined but not used [-Wunused-const-variable=]
159 | static const unsigned short ModeIndex_768x576[] = { 0x5f, 0x60, 0x00, 0x61 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:158:29: warning: 'ModeIndex_720x576' defined but not used [-Wunused-const-variable=]
158 | static const unsigned short ModeIndex_720x576[] = { 0x32, 0x34, 0x00, 0x36 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:157:29: warning: 'ModeIndex_720x480' defined but not used [-Wunused-const-variable=]
157 | static const unsigned short ModeIndex_720x480[] = { 0x31, 0x33, 0x00, 0x35 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:156:29: warning: 'ModeIndex_640x480' defined but not used [-Wunused-const-variable=]
156 | static const unsigned short ModeIndex_640x480[] = { 0x2e, 0x44, 0x00, 0x62 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:155:29: warning: 'ModeIndex_640x400' defined but not used [-Wunused-const-variable=]
155 | static const unsigned short ModeIndex_640x400[] = { 0x2f, 0x5d, 0x00, 0x5e };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:154:29: warning: 'ModeIndex_512x384' defined but not used [-Wunused-const-variable=]
154 | static const unsigned short ModeIndex_512x384[] = { 0x52, 0x58, 0x00, 0x5c };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:153:29: warning: 'ModeIndex_400x300' defined but not used [-Wunused-const-variable=]
153 | static const unsigned short ModeIndex_400x300[] = { 0x51, 0x57, 0x00, 0x54 };
|                             ^~~~~~~~~~~~~~~~~
drivers/usb/misc/sisusbvga/sisusb_init.h:152:29: warning: 'ModeIndex_320x240' defined but not used [-Wunused-const-variable=]
152 | static const unsigned short ModeIndex_320x240[] = { 0x50, 0x56, 0x00, 0x53 };
|                             ^~~~~~~~~~~~~~~~~

vim +2997 drivers/usb/misc/sisusbvga/sisusb.c

^1da177e4c3f41 Linus Torvalds              2005-04-16  2991  
066202dd48cf32 Luiz Fernando N. Capitulino 2006-08-05  2992  static const struct file_operations usb_sisusb_fops = {
^1da177e4c3f41 Linus Torvalds              2005-04-16  2993  	.owner =	THIS_MODULE,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2994  	.open =		sisusb_open,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2995  	.release =	sisusb_release,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2996  	.read =		sisusb_read,
^1da177e4c3f41 Linus Torvalds              2005-04-16 @2997  	.write =	sisusb_write,
^1da177e4c3f41 Linus Torvalds              2005-04-16  2998  	.llseek =	sisusb_lseek,
022e468e139573 Jiri Slaby                  2019-01-22  2999  #ifdef CONFIG_COMPAT
^1da177e4c3f41 Linus Torvalds              2005-04-16  3000  	.compat_ioctl = sisusb_compat_ioctl,
^1da177e4c3f41 Linus Torvalds              2005-04-16  3001  #endif
49f15255465321 Alan Cox                    2008-05-22  3002  	.unlocked_ioctl = sisusb_ioctl
^1da177e4c3f41 Linus Torvalds              2005-04-16  3003  };
^1da177e4c3f41 Linus Torvalds              2005-04-16  3004  

:::::: The code at line 2997 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

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;