Re: [PATCH v3] staging: ccree: fixed sparse pointer signedness warnings.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-01-10, at 15:03:01 +0200, Gilad Ben-Yossef wrote:
> On Wed, Jan 10, 2018 at 1:53 PM, Jeremy Sowden wrote:
> > The driver uses a mixture of signed and unsigned integer variables
> > for holding arrays lengths and indices, which gives rise to sparse
> > warnings when the addresses of signed variables are passed to
> > functions expecting
>
> Just curious, I didn't see these warning when running sparse myself.
> Can you share the command line/flags you've used?

make C=2 CF=-Wsparse-all M=drivers/staging/ccree 2>&1

Output attached.

> > pointers to unsigned integers.  This patch fixes those warnings by
> > converting those signed variables to unsigned as follows:
> >
> >   * removed some hard-coded array indices.
>
> Removing the hard coded array indices is a separate and different
> issue and so needs to be dealt it in a separate patch. Please split
> your patch into a patchset: one for removing the hard coded values and
> one for the signed/unsigned remedy.

Will do.

J.
[azazel@ulthar:/space/azazel/work/linux/staging] $ git checkout staging-next
Switched to branch 'staging-next'
Your branch is up to date with 'origin/staging-next'.
[azazel@ulthar:/space/azazel/work/linux/staging] $ make C=2 CF=-Wsparse-all M=drivers/staging/ccree 2>&1
  CHECK   drivers/staging/ccree/cc_driver.c
  CHECK   drivers/staging/ccree/cc_buffer_mgr.c
drivers/staging/ccree/cc_buffer_mgr.c:1050:46: warning: incorrect type in argument 4 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1050:46:    expected unsigned int [usertype] *lbytes
drivers/staging/ccree/cc_buffer_mgr.c:1050:46:    got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1083:62: warning: incorrect type in argument 7 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1083:62:    expected unsigned int [usertype] *lbytes
drivers/staging/ccree/cc_buffer_mgr.c:1083:62:    got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1092:46: warning: incorrect type in argument 4 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1092:46:    expected unsigned int [usertype] *lbytes
drivers/staging/ccree/cc_buffer_mgr.c:1092:46:    got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1120:49: warning: incorrect type in argument 4 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1120:49:    expected unsigned int [usertype] *src_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1120:49:    got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1121:49: warning: incorrect type in argument 5 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1121:49:    expected unsigned int [usertype] *dst_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1121:49:    got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1124:49: warning: incorrect type in argument 2 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1124:49:    expected unsigned int [usertype] *src_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1124:49:    got int *<noident>
drivers/staging/ccree/cc_buffer_mgr.c:1125:44: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_buffer_mgr.c:1125:44:    expected unsigned int [usertype] *dst_last_bytes
drivers/staging/ccree/cc_buffer_mgr.c:1125:44:    got int *<noident>
  CC [M]  drivers/staging/ccree/cc_buffer_mgr.o
  CHECK   drivers/staging/ccree/cc_request_mgr.c
  CHECK   drivers/staging/ccree/cc_cipher.c
drivers/staging/ccree/cc_cipher.c:358:17: warning: Variable length array is used.
drivers/staging/ccree/cc_cipher.c:700:67: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_cipher.c:700:67:    expected unsigned int *seq_size
drivers/staging/ccree/cc_cipher.c:700:67:    got int *<noident>
drivers/staging/ccree/cc_cipher.c:703:31: warning: incorrect type in argument 8 (different signedness)
drivers/staging/ccree/cc_cipher.c:703:31:    expected unsigned int *seq_size
drivers/staging/ccree/cc_cipher.c:703:31:    got int *<noident>
  CC [M]  drivers/staging/ccree/cc_cipher.o
  CHECK   drivers/staging/ccree/cc_hash.c
drivers/staging/ccree/cc_hash.c:480:57: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:480:57:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:480:57:    got int *<noident>
drivers/staging/ccree/cc_hash.c:530:57: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:530:57:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:530:57:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1305:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1305:43:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1305:43:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1307:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1307:43:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1307:43:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1317:69: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:1317:69:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1317:69:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1390:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1390:43:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1390:43:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1393:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1393:43:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1393:43:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1404:69: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:1404:69:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1404:69:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1469:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1469:43:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1469:43:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1472:43: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_hash.c:1472:43:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1472:43:    got int *<noident>
drivers/staging/ccree/cc_hash.c:1483:69: warning: incorrect type in argument 6 (different signedness)
drivers/staging/ccree/cc_hash.c:1483:69:    expected unsigned int *seq_size
drivers/staging/ccree/cc_hash.c:1483:69:    got int *<noident>
  CC [M]  drivers/staging/ccree/cc_hash.o
  CHECK   drivers/staging/ccree/cc_aead.c
drivers/staging/ccree/cc_aead.c:2011:37: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2011:37:    expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2011:37:    got int *<noident>
drivers/staging/ccree/cc_aead.c:2017:45: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2017:45:    expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2017:45:    got int *<noident>
drivers/staging/ccree/cc_aead.c:2020:45: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2020:45:    expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2020:45:    got int *<noident>
drivers/staging/ccree/cc_aead.c:2024:44: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2024:44:    expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2024:44:    got int *<noident>
drivers/staging/ccree/cc_aead.c:2026:44: warning: incorrect type in argument 3 (different signedness)
drivers/staging/ccree/cc_aead.c:2026:44:    expected unsigned int *seq_size
drivers/staging/ccree/cc_aead.c:2026:44:    got int *<noident>
  CC [M]  drivers/staging/ccree/cc_aead.o
  CHECK   drivers/staging/ccree/cc_ivgen.c
  CHECK   drivers/staging/ccree/cc_sram_mgr.c
  CHECK   drivers/staging/ccree/cc_debugfs.c
  CHECK   drivers/staging/ccree/cc_pm.c
  LD [M]  drivers/staging/ccree/ccree.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      drivers/staging/ccree/ccree.mod.o
  LD [M]  drivers/staging/ccree/ccree.ko

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux