usb: isp1760: fix strict typechecking
authorRui Miguel Silva <rui.silva@linaro.org>
Thu, 13 May 2021 08:47:09 +0000 (09:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 18:05:31 +0000 (20:05 +0200)
commitabfabc8ae3bd625f57fa35d25f2435bb6465a3b1
tree327d4aa884a5ac37bb95bc1c2b3da79a42d309be
parent24bb0076d7bc0ea4caf0af55bd0273a1c343748a
usb: isp1760: fix strict typechecking

There are a lot of pre-existing typechecking warnings around the
access and assign of elements of ptd structure of __dw type.

sparse: warning: invalid assignment: |=
sparse:    left side has type restricted __dw
sparse:    right side has type unsigned int

or

warning: restricted __dw degrades to integer

or

sparse: warning: incorrect type in assignment (different base types)
sparse:    expected restricted __dw [usertype] dw4
sparse:    got unsigned int [assigned] [usertype] usof

To handle this, annotate conversions along the {TO,FROM}_DW* macros
and some assignments and function arguments.

This clean up completely all sparse warnings for this driver.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-2-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/isp1760/isp1760-hcd.c