Re: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Peter Chen
On 20-12-15 06:14:07, Pawel Laszczak wrote:
> >On 20-12-15 05:27:38, Pawel Laszczak wrote:
> >> >
> >> >
> >> >On 20-12-14 13:03:44, Pawel Laszczak wrote:
> >> >> Patch fixes all sparse warnings in cdsnp driver.
> >> >>
> >> >> It fixes the following warnings:
> >> >> cdnsp-ring.c:1441: warning: incorrect type in assignment
> >> >> cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
> >> >> cdnsp-ring.c:2200: warning: dubious: x | !y
> >> >> cdnsp-gadget.c:501: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
> >> >> cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
> >> >> cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
> >> >> cdnsp-gadget.c:509: warning: invalid assignment: |=
> >> >> cdnsp-gadget.c:510: warning: cast from restricted __le32
> >> >> cdnsp-gadget.c:558: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
> >> >> cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
> >> >> cdnsp-gadget.c:1571: warning: incorrect type in argument 1
> >> >> cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
> >> >> cdnsp-gadget.c:1760: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:1762: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:1763: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:1764: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:1765: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:1766: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:1767: warning: incorrect type in assignment
> >> >> cdnsp-gadget.c:458: warning: cast truncates bits from constant value
> >> >> (07ff becomes 7ff)
> >> >> cdnsp-gadget.c:666: warning: cast truncates bits from constant value
> >> >> (07ff becomes 7ff)
> >> >> cdnsp-mem.c:762: warning: incorrect type in assignment
> >> >> cdnsp-mem.c:763: warning: incorrect type in assignment
> >> >> cdnsp-mem.c:928: warning: cast from restricted __le16
> >> >> cdnsp-mem.c:1187: warning: incorrect type in assignment
> >> >> cdnsp-mem.c:1191: warning: incorrect type in assignment
> >> >> cdnsp-ep0.c:142: warning: incorrect type in assignment
> >> >> cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
> >> >> cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
> >> >> cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
> >> >> cdnsp-ep0.c:179: warning: incorrect type in argument 1
> >> >> cdnsp-ep0.c:311: warning: incorrect type in argument 1
> >> >> cdnsp-ep0.c:469: warning: incorrect type in assignment
> >> >> cdnsp-trace.h:611:1: warning: cast from restricted __le32
> >> >>
> >> >> Signed-off-by: Pawel Laszczak 
> >> >> Reported-by: kernel test robot 
> >> >
> >> >Hi Pawel,
> >> >
> >> >The Reported-by tag should be above your Sob tag, I will change it.
> >> >Except the patch reported build error by kernel test robot, I will apply
> >> >your other four patches after finishing the compile test.
> >> >
> >> >Peter
> >>
> >> Hi Peter,
> >>
> >> I'm going to fix the "usb: cdns3: Adds missing __iomem markers"  today.
> >> I haven't  seen any issue on ARCH=parisc. Maybe it's some specific riscv 
> >> arch issue.
> >>
> >> I believe that:
> >> [auto build test WARNING on next-20201211]
> >> [cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 
> >> v5.10]
> >>
> >> is not the problem. I based on  peter.chen-usb/for-usb-next.
> >>
> >> Also I can't open the url from kernel test robot report.
> >> Maybe there is some temporary issue with server.
> >>
> >
> >Thanks for checking it, I have already pushed your other four patches.
> >Besides, there is still a build error issue for new cdns3 driver.
> >
> >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fwww.spinics.net%2Flists%2Flinux-data=04%7C01%7Cpeter.chen%40nxp.com%7Cf036cd7630664c9e0c5c08d8a0c0a637%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637436096594708469%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=DLBFVB2px5GgA6Y%2FTU4DrfVru6z3P4RXz2x7BSpdE4o%3Dreserved=0
> >usb/msg206073.html__;!!EHscmS1ygiU1lA!X6rYk64ILtzjyHW903LAhBRjMKi9C2eyJWEXVlEZm0ly2BiNzY2wK46Ulq7q5w$
> >
> 
> Did you applied: [PATCH] usb: cdnsp: Fix for undefined reference to 
> `usb_hcd_is_primary_hcd' ?
> 

Applied now.

-- 

Thanks,
Peter Chen

RE: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Pawel Laszczak
>>On 20-12-15 05:27:38, Pawel Laszczak wrote:
>>> >
>>> >
>>> >On 20-12-14 13:03:44, Pawel Laszczak wrote:
>>> >> Patch fixes all sparse warnings in cdsnp driver.
>>> >>
>>> >> It fixes the following warnings:
>>> >> cdnsp-ring.c:1441: warning: incorrect type in assignment
>>> >> cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
>>> >> cdnsp-ring.c:2200: warning: dubious: x | !y
>>> >> cdnsp-gadget.c:501: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
>>> >> cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
>>> >> cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
>>> >> cdnsp-gadget.c:509: warning: invalid assignment: |=
>>> >> cdnsp-gadget.c:510: warning: cast from restricted __le32
>>> >> cdnsp-gadget.c:558: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
>>> >> cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
>>> >> cdnsp-gadget.c:1571: warning: incorrect type in argument 1
>>> >> cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
>>> >> cdnsp-gadget.c:1760: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:1762: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:1763: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:1764: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:1765: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:1766: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:1767: warning: incorrect type in assignment
>>> >> cdnsp-gadget.c:458: warning: cast truncates bits from constant value
>>> >> (07ff becomes 7ff)
>>> >> cdnsp-gadget.c:666: warning: cast truncates bits from constant value
>>> >> (07ff becomes 7ff)
>>> >> cdnsp-mem.c:762: warning: incorrect type in assignment
>>> >> cdnsp-mem.c:763: warning: incorrect type in assignment
>>> >> cdnsp-mem.c:928: warning: cast from restricted __le16
>>> >> cdnsp-mem.c:1187: warning: incorrect type in assignment
>>> >> cdnsp-mem.c:1191: warning: incorrect type in assignment
>>> >> cdnsp-ep0.c:142: warning: incorrect type in assignment
>>> >> cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
>>> >> cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
>>> >> cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
>>> >> cdnsp-ep0.c:179: warning: incorrect type in argument 1
>>> >> cdnsp-ep0.c:311: warning: incorrect type in argument 1
>>> >> cdnsp-ep0.c:469: warning: incorrect type in assignment
>>> >> cdnsp-trace.h:611:1: warning: cast from restricted __le32
>>> >>
>>> >> Signed-off-by: Pawel Laszczak 
>>> >> Reported-by: kernel test robot 
>>> >
>>> >Hi Pawel,
>>> >
>>> >The Reported-by tag should be above your Sob tag, I will change it.
>>> >Except the patch reported build error by kernel test robot, I will apply
>>> >your other four patches after finishing the compile test.
>>> >
>>> >Peter
>>>
>>> Hi Peter,
>>>
>>> I'm going to fix the "usb: cdns3: Adds missing __iomem markers"  today.
>>> I haven't  seen any issue on ARCH=parisc. Maybe it's some specific riscv 
>>> arch issue.
>>>
>>> I believe that:
>>> [auto build test WARNING on next-20201211]
>>> [cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 
>>> v5.10]
>>>
>>> is not the problem. I based on  peter.chen-usb/for-usb-next.
>>>
>>> Also I can't open the url from kernel test robot report.
>>> Maybe there is some temporary issue with server.
>>>
>>
>>Thanks for checking it, I have already pushed your other four patches.
>>Besides, there is still a build error issue for new cdns3 driver.
>>
>>https://urldefense.com/v3/__https://www.spinics.net/lists/linux-
>>usb/msg206073.html__;!!EHscmS1ygiU1lA!X6rYk64ILtzjyHW903LAhBRjMKi9C2eyJWEXVlEZm0ly2BiNzY2wK46Ulq7q5w$
>>
>
>Did you applied: [PATCH] usb: cdnsp: Fix for undefined reference to 
>`usb_hcd_is_primary_hcd' ?

It's my local log:

ab474baa0302 (HEAD -> for-usb-next) usb: cdns3: Adds missing __iomem markers
4af8270829f2 usb: cdnsp: Fixes for sparse warnings
4f5f85f26e77 usb: cdns3: Fixes for sparse warnings
cd41bb30fc26 dan.carpenter@oracle.comusb: cdnsp: fix error handling in 
cdnsp_mem_init()
1918b1486f94 usb: cdns3: Removes xhci_cdns3_suspend_quirk from host-export.h
d47d84a1cd8a usb: cdnsp: Fix for undefined reference to `usb_hcd_is_primary_hcd'
df1b6960d363 (peter.chen-usb/for-usb-next) usb: cdnsp: Removes some not useful 
function arguments
94e0623337a6 usb: cdns3: fix warning when USB_CDNS_HOST is not set

>Pawel
>
>>Peter
>>> Thanks,
>>> Pawel
>>>
>>> >> ---
>>> >>  drivers/usb/cdns3/cdnsp-debug.h  |  2 +-
>>> >>  drivers/usb/cdns3/cdnsp-ep0.c| 13 ++---
>>> >>  drivers/usb/cdns3/cdnsp-gadget.c | 24 +---
>>> >>  drivers/usb/cdns3/cdnsp-gadget.h | 13 +++--
>>> >>  drivers/usb/cdns3/cdnsp-mem.c| 11 

RE: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Pawel Laszczak
>On 20-12-15 05:27:38, Pawel Laszczak wrote:
>> >
>> >
>> >On 20-12-14 13:03:44, Pawel Laszczak wrote:
>> >> Patch fixes all sparse warnings in cdsnp driver.
>> >>
>> >> It fixes the following warnings:
>> >> cdnsp-ring.c:1441: warning: incorrect type in assignment
>> >> cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
>> >> cdnsp-ring.c:2200: warning: dubious: x | !y
>> >> cdnsp-gadget.c:501: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
>> >> cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
>> >> cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
>> >> cdnsp-gadget.c:509: warning: invalid assignment: |=
>> >> cdnsp-gadget.c:510: warning: cast from restricted __le32
>> >> cdnsp-gadget.c:558: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
>> >> cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
>> >> cdnsp-gadget.c:1571: warning: incorrect type in argument 1
>> >> cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
>> >> cdnsp-gadget.c:1760: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:1762: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:1763: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:1764: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:1765: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:1766: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:1767: warning: incorrect type in assignment
>> >> cdnsp-gadget.c:458: warning: cast truncates bits from constant value
>> >> (07ff becomes 7ff)
>> >> cdnsp-gadget.c:666: warning: cast truncates bits from constant value
>> >> (07ff becomes 7ff)
>> >> cdnsp-mem.c:762: warning: incorrect type in assignment
>> >> cdnsp-mem.c:763: warning: incorrect type in assignment
>> >> cdnsp-mem.c:928: warning: cast from restricted __le16
>> >> cdnsp-mem.c:1187: warning: incorrect type in assignment
>> >> cdnsp-mem.c:1191: warning: incorrect type in assignment
>> >> cdnsp-ep0.c:142: warning: incorrect type in assignment
>> >> cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
>> >> cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
>> >> cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
>> >> cdnsp-ep0.c:179: warning: incorrect type in argument 1
>> >> cdnsp-ep0.c:311: warning: incorrect type in argument 1
>> >> cdnsp-ep0.c:469: warning: incorrect type in assignment
>> >> cdnsp-trace.h:611:1: warning: cast from restricted __le32
>> >>
>> >> Signed-off-by: Pawel Laszczak 
>> >> Reported-by: kernel test robot 
>> >
>> >Hi Pawel,
>> >
>> >The Reported-by tag should be above your Sob tag, I will change it.
>> >Except the patch reported build error by kernel test robot, I will apply
>> >your other four patches after finishing the compile test.
>> >
>> >Peter
>>
>> Hi Peter,
>>
>> I'm going to fix the "usb: cdns3: Adds missing __iomem markers"  today.
>> I haven't  seen any issue on ARCH=parisc. Maybe it's some specific riscv 
>> arch issue.
>>
>> I believe that:
>> [auto build test WARNING on next-20201211]
>> [cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 
>> v5.10]
>>
>> is not the problem. I based on  peter.chen-usb/for-usb-next.
>>
>> Also I can't open the url from kernel test robot report.
>> Maybe there is some temporary issue with server.
>>
>
>Thanks for checking it, I have already pushed your other four patches.
>Besides, there is still a build error issue for new cdns3 driver.
>
>https://urldefense.com/v3/__https://www.spinics.net/lists/linux-
>usb/msg206073.html__;!!EHscmS1ygiU1lA!X6rYk64ILtzjyHW903LAhBRjMKi9C2eyJWEXVlEZm0ly2BiNzY2wK46Ulq7q5w$
>

Did you applied: [PATCH] usb: cdnsp: Fix for undefined reference to 
`usb_hcd_is_primary_hcd' ?

Pawel

>Peter
>> Thanks,
>> Pawel
>>
>> >> ---
>> >>  drivers/usb/cdns3/cdnsp-debug.h  |  2 +-
>> >>  drivers/usb/cdns3/cdnsp-ep0.c| 13 ++---
>> >>  drivers/usb/cdns3/cdnsp-gadget.c | 24 +---
>> >>  drivers/usb/cdns3/cdnsp-gadget.h | 13 +++--
>> >>  drivers/usb/cdns3/cdnsp-mem.c| 11 ++-
>> >>  drivers/usb/cdns3/cdnsp-ring.c   |  4 ++--
>> >>  drivers/usb/cdns3/cdnsp-trace.h  |  2 +-
>> >>  7 files changed, 32 insertions(+), 37 deletions(-)
>> >>
>> >> diff --git a/drivers/usb/cdns3/cdnsp-debug.h 
>> >> b/drivers/usb/cdns3/cdnsp-debug.h
>> >> index d6345d4d2911..a8776df2d4e0 100644
>> >> --- a/drivers/usb/cdns3/cdnsp-debug.h
>> >> +++ b/drivers/usb/cdns3/cdnsp-debug.h
>> >> @@ -414,7 +414,7 @@ static inline const char 
>> >> *cdnsp_decode_slot_context(u32 info, u32 info2,
>> >>   s = "UNKNOWN speed";
>> >>   }
>> >>
>> >> - ret = sprintf(str, "%s Ctx Entries %ld",
>> >> + ret = sprintf(str, "%s Ctx Entries %d",
>> >> s, (info & LAST_CTX_MASK) >> 

Re: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Peter Chen
On 20-12-15 05:27:38, Pawel Laszczak wrote:
> >
> >
> >On 20-12-14 13:03:44, Pawel Laszczak wrote:
> >> Patch fixes all sparse warnings in cdsnp driver.
> >>
> >> It fixes the following warnings:
> >> cdnsp-ring.c:1441: warning: incorrect type in assignment
> >> cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
> >> cdnsp-ring.c:2200: warning: dubious: x | !y
> >> cdnsp-gadget.c:501: warning: incorrect type in assignment
> >> cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
> >> cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
> >> cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
> >> cdnsp-gadget.c:509: warning: invalid assignment: |=
> >> cdnsp-gadget.c:510: warning: cast from restricted __le32
> >> cdnsp-gadget.c:558: warning: incorrect type in assignment
> >> cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
> >> cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
> >> cdnsp-gadget.c:1571: warning: incorrect type in argument 1
> >> cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
> >> cdnsp-gadget.c:1760: warning: incorrect type in assignment
> >> cdnsp-gadget.c:1762: warning: incorrect type in assignment
> >> cdnsp-gadget.c:1763: warning: incorrect type in assignment
> >> cdnsp-gadget.c:1764: warning: incorrect type in assignment
> >> cdnsp-gadget.c:1765: warning: incorrect type in assignment
> >> cdnsp-gadget.c:1766: warning: incorrect type in assignment
> >> cdnsp-gadget.c:1767: warning: incorrect type in assignment
> >> cdnsp-gadget.c:458: warning: cast truncates bits from constant value
> >> (07ff becomes 7ff)
> >> cdnsp-gadget.c:666: warning: cast truncates bits from constant value
> >> (07ff becomes 7ff)
> >> cdnsp-mem.c:762: warning: incorrect type in assignment
> >> cdnsp-mem.c:763: warning: incorrect type in assignment
> >> cdnsp-mem.c:928: warning: cast from restricted __le16
> >> cdnsp-mem.c:1187: warning: incorrect type in assignment
> >> cdnsp-mem.c:1191: warning: incorrect type in assignment
> >> cdnsp-ep0.c:142: warning: incorrect type in assignment
> >> cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
> >> cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
> >> cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
> >> cdnsp-ep0.c:179: warning: incorrect type in argument 1
> >> cdnsp-ep0.c:311: warning: incorrect type in argument 1
> >> cdnsp-ep0.c:469: warning: incorrect type in assignment
> >> cdnsp-trace.h:611:1: warning: cast from restricted __le32
> >>
> >> Signed-off-by: Pawel Laszczak 
> >> Reported-by: kernel test robot 
> >
> >Hi Pawel,
> >
> >The Reported-by tag should be above your Sob tag, I will change it.
> >Except the patch reported build error by kernel test robot, I will apply
> >your other four patches after finishing the compile test.
> >
> >Peter
> 
> Hi Peter,
> 
> I'm going to fix the "usb: cdns3: Adds missing __iomem markers"  today.
> I haven't  seen any issue on ARCH=parisc. Maybe it's some specific riscv arch 
> issue.
> 
> I believe that:
> [auto build test WARNING on next-20201211]
> [cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 
> v5.10]
> 
> is not the problem. I based on  peter.chen-usb/for-usb-next.
> 
> Also I can't open the url from kernel test robot report.
> Maybe there is some temporary issue with server. 
> 

Thanks for checking it, I have already pushed your other four patches.
Besides, there is still a build error issue for new cdns3 driver.

https://www.spinics.net/lists/linux-usb/msg206073.html

Peter
> Thanks,
> Pawel
> 
> >> ---
> >>  drivers/usb/cdns3/cdnsp-debug.h  |  2 +-
> >>  drivers/usb/cdns3/cdnsp-ep0.c| 13 ++---
> >>  drivers/usb/cdns3/cdnsp-gadget.c | 24 +---
> >>  drivers/usb/cdns3/cdnsp-gadget.h | 13 +++--
> >>  drivers/usb/cdns3/cdnsp-mem.c| 11 ++-
> >>  drivers/usb/cdns3/cdnsp-ring.c   |  4 ++--
> >>  drivers/usb/cdns3/cdnsp-trace.h  |  2 +-
> >>  7 files changed, 32 insertions(+), 37 deletions(-)
> >>
> >> diff --git a/drivers/usb/cdns3/cdnsp-debug.h 
> >> b/drivers/usb/cdns3/cdnsp-debug.h
> >> index d6345d4d2911..a8776df2d4e0 100644
> >> --- a/drivers/usb/cdns3/cdnsp-debug.h
> >> +++ b/drivers/usb/cdns3/cdnsp-debug.h
> >> @@ -414,7 +414,7 @@ static inline const char 
> >> *cdnsp_decode_slot_context(u32 info, u32 info2,
> >>s = "UNKNOWN speed";
> >>}
> >>
> >> -  ret = sprintf(str, "%s Ctx Entries %ld",
> >> +  ret = sprintf(str, "%s Ctx Entries %d",
> >>  s, (info & LAST_CTX_MASK) >> 27);
> >>
> >>ret += sprintf(str + ret, " [Intr %ld] Addr %ld State %s",
> >> diff --git a/drivers/usb/cdns3/cdnsp-ep0.c b/drivers/usb/cdns3/cdnsp-ep0.c
> >> index d55b59ed7381..e2b1bcb3f80e 100644
> >> --- a/drivers/usb/cdns3/cdnsp-ep0.c
> >> +++ b/drivers/usb/cdns3/cdnsp-ep0.c
> >> @@ -137,10 +137,8 @@ 

RE: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Pawel Laszczak
>
>
>On 20-12-14 13:03:44, Pawel Laszczak wrote:
>> Patch fixes all sparse warnings in cdsnp driver.
>>
>> It fixes the following warnings:
>> cdnsp-ring.c:1441: warning: incorrect type in assignment
>> cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
>> cdnsp-ring.c:2200: warning: dubious: x | !y
>> cdnsp-gadget.c:501: warning: incorrect type in assignment
>> cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
>> cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
>> cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
>> cdnsp-gadget.c:509: warning: invalid assignment: |=
>> cdnsp-gadget.c:510: warning: cast from restricted __le32
>> cdnsp-gadget.c:558: warning: incorrect type in assignment
>> cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
>> cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
>> cdnsp-gadget.c:1571: warning: incorrect type in argument 1
>> cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
>> cdnsp-gadget.c:1760: warning: incorrect type in assignment
>> cdnsp-gadget.c:1762: warning: incorrect type in assignment
>> cdnsp-gadget.c:1763: warning: incorrect type in assignment
>> cdnsp-gadget.c:1764: warning: incorrect type in assignment
>> cdnsp-gadget.c:1765: warning: incorrect type in assignment
>> cdnsp-gadget.c:1766: warning: incorrect type in assignment
>> cdnsp-gadget.c:1767: warning: incorrect type in assignment
>> cdnsp-gadget.c:458: warning: cast truncates bits from constant value
>> (07ff becomes 7ff)
>> cdnsp-gadget.c:666: warning: cast truncates bits from constant value
>> (07ff becomes 7ff)
>> cdnsp-mem.c:762: warning: incorrect type in assignment
>> cdnsp-mem.c:763: warning: incorrect type in assignment
>> cdnsp-mem.c:928: warning: cast from restricted __le16
>> cdnsp-mem.c:1187: warning: incorrect type in assignment
>> cdnsp-mem.c:1191: warning: incorrect type in assignment
>> cdnsp-ep0.c:142: warning: incorrect type in assignment
>> cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
>> cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
>> cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
>> cdnsp-ep0.c:179: warning: incorrect type in argument 1
>> cdnsp-ep0.c:311: warning: incorrect type in argument 1
>> cdnsp-ep0.c:469: warning: incorrect type in assignment
>> cdnsp-trace.h:611:1: warning: cast from restricted __le32
>>
>> Signed-off-by: Pawel Laszczak 
>> Reported-by: kernel test robot 
>
>Hi Pawel,
>
>The Reported-by tag should be above your Sob tag, I will change it.
>Except the patch reported build error by kernel test robot, I will apply
>your other four patches after finishing the compile test.
>
>Peter

Hi Peter,

I'm going to fix the "usb: cdns3: Adds missing __iomem markers"  today.
I haven't  seen any issue on ARCH=parisc. Maybe it's some specific riscv arch 
issue.

I believe that:
[auto build test WARNING on next-20201211]
[cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 v5.10]

is not the problem. I based on  peter.chen-usb/for-usb-next.

Also I can't open the url from kernel test robot report.
Maybe there is some temporary issue with server. 

Thanks,
Pawel

>> ---
>>  drivers/usb/cdns3/cdnsp-debug.h  |  2 +-
>>  drivers/usb/cdns3/cdnsp-ep0.c| 13 ++---
>>  drivers/usb/cdns3/cdnsp-gadget.c | 24 +---
>>  drivers/usb/cdns3/cdnsp-gadget.h | 13 +++--
>>  drivers/usb/cdns3/cdnsp-mem.c| 11 ++-
>>  drivers/usb/cdns3/cdnsp-ring.c   |  4 ++--
>>  drivers/usb/cdns3/cdnsp-trace.h  |  2 +-
>>  7 files changed, 32 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/usb/cdns3/cdnsp-debug.h 
>> b/drivers/usb/cdns3/cdnsp-debug.h
>> index d6345d4d2911..a8776df2d4e0 100644
>> --- a/drivers/usb/cdns3/cdnsp-debug.h
>> +++ b/drivers/usb/cdns3/cdnsp-debug.h
>> @@ -414,7 +414,7 @@ static inline const char *cdnsp_decode_slot_context(u32 
>> info, u32 info2,
>>  s = "UNKNOWN speed";
>>  }
>>
>> -ret = sprintf(str, "%s Ctx Entries %ld",
>> +ret = sprintf(str, "%s Ctx Entries %d",
>>s, (info & LAST_CTX_MASK) >> 27);
>>
>>  ret += sprintf(str + ret, " [Intr %ld] Addr %ld State %s",
>> diff --git a/drivers/usb/cdns3/cdnsp-ep0.c b/drivers/usb/cdns3/cdnsp-ep0.c
>> index d55b59ed7381..e2b1bcb3f80e 100644
>> --- a/drivers/usb/cdns3/cdnsp-ep0.c
>> +++ b/drivers/usb/cdns3/cdnsp-ep0.c
>> @@ -137,10 +137,8 @@ int cdnsp_status_stage(struct cdnsp_device *pdev)
>>  return cdnsp_ep_enqueue(pdev->ep0_preq.pep, >ep0_preq);
>>  }
>>
>> -static int cdnsp_w_index_to_ep_index(__le32  wIndex)
>> +static int cdnsp_w_index_to_ep_index(u16 wIndex)
>>  {
>> -wIndex = le32_to_cpu(wIndex);
>> -
>>  if (!(wIndex & USB_ENDPOINT_NUMBER_MASK))
>>  return 0;
>>
>> @@ -176,7 +174,8 @@ static int cdnsp_ep0_handle_status(struct cdnsp_device 
>> 

Re: [PATCH 1/2] usb: cdnsp: Fixes for sparse warnings

2020-12-14 Thread Peter Chen
On 20-12-14 13:03:44, Pawel Laszczak wrote:
> Patch fixes all sparse warnings in cdsnp driver.
> 
> It fixes the following warnings:
> cdnsp-ring.c:1441: warning: incorrect type in assignment
> cdnsp-ring.c:1444: warning: restricted __le32 degrades to integer
> cdnsp-ring.c:2200: warning: dubious: x | !y
> cdnsp-gadget.c:501: warning: incorrect type in assignment
> cdnsp-gadget.c:504: warning: restricted __le32 degrades to integer
> cdnsp-gadget.c:507: warning: restricted __le32 degrades to integer
> cdnsp-gadget.c:508: warning: restricted __le32 degrades to integer
> cdnsp-gadget.c:509: warning: invalid assignment: |=
> cdnsp-gadget.c:510: warning: cast from restricted __le32
> cdnsp-gadget.c:558: warning: incorrect type in assignment
> cdnsp-gadget.c:561: warning: restricted __le32 degrades to integer
> cdnsp-gadget.c:570: warning: restricted __le32 degrades to integer
> cdnsp-gadget.c:1571: warning: incorrect type in argument 1
> cdnsp-gadget.c:1602: warning: restricted __le32 degrades to integer
> cdnsp-gadget.c:1760: warning: incorrect type in assignment
> cdnsp-gadget.c:1762: warning: incorrect type in assignment
> cdnsp-gadget.c:1763: warning: incorrect type in assignment
> cdnsp-gadget.c:1764: warning: incorrect type in assignment
> cdnsp-gadget.c:1765: warning: incorrect type in assignment
> cdnsp-gadget.c:1766: warning: incorrect type in assignment
> cdnsp-gadget.c:1767: warning: incorrect type in assignment
> cdnsp-gadget.c:458: warning: cast truncates bits from constant value
> (07ff becomes 7ff)
> cdnsp-gadget.c:666: warning: cast truncates bits from constant value
> (07ff becomes 7ff)
> cdnsp-mem.c:762: warning: incorrect type in assignment
> cdnsp-mem.c:763: warning: incorrect type in assignment
> cdnsp-mem.c:928: warning: cast from restricted __le16
> cdnsp-mem.c:1187: warning: incorrect type in assignment
> cdnsp-mem.c:1191: warning: incorrect type in assignment
> cdnsp-ep0.c:142: warning: incorrect type in assignment
> cdnsp-ep0.c:144: warning: restricted __le32 degrades to integer
> cdnsp-ep0.c:147: warning: restricted __le32 degrades to integer
> cdnsp-ep0.c:148: warning: restricted __le32 degrades to integer
> cdnsp-ep0.c:179: warning: incorrect type in argument 1
> cdnsp-ep0.c:311: warning: incorrect type in argument 1
> cdnsp-ep0.c:469: warning: incorrect type in assignment
> cdnsp-trace.h:611:1: warning: cast from restricted __le32
> 
> Signed-off-by: Pawel Laszczak 
> Reported-by: kernel test robot 

Hi Pawel,

The Reported-by tag should be above your Sob tag, I will change it.
Except the patch reported build error by kernel test robot, I will apply
your other four patches after finishing the compile test.

Peter

> ---
>  drivers/usb/cdns3/cdnsp-debug.h  |  2 +-
>  drivers/usb/cdns3/cdnsp-ep0.c| 13 ++---
>  drivers/usb/cdns3/cdnsp-gadget.c | 24 +---
>  drivers/usb/cdns3/cdnsp-gadget.h | 13 +++--
>  drivers/usb/cdns3/cdnsp-mem.c| 11 ++-
>  drivers/usb/cdns3/cdnsp-ring.c   |  4 ++--
>  drivers/usb/cdns3/cdnsp-trace.h  |  2 +-
>  7 files changed, 32 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/cdnsp-debug.h b/drivers/usb/cdns3/cdnsp-debug.h
> index d6345d4d2911..a8776df2d4e0 100644
> --- a/drivers/usb/cdns3/cdnsp-debug.h
> +++ b/drivers/usb/cdns3/cdnsp-debug.h
> @@ -414,7 +414,7 @@ static inline const char *cdnsp_decode_slot_context(u32 
> info, u32 info2,
>   s = "UNKNOWN speed";
>   }
>  
> - ret = sprintf(str, "%s Ctx Entries %ld",
> + ret = sprintf(str, "%s Ctx Entries %d",
> s, (info & LAST_CTX_MASK) >> 27);
>  
>   ret += sprintf(str + ret, " [Intr %ld] Addr %ld State %s",
> diff --git a/drivers/usb/cdns3/cdnsp-ep0.c b/drivers/usb/cdns3/cdnsp-ep0.c
> index d55b59ed7381..e2b1bcb3f80e 100644
> --- a/drivers/usb/cdns3/cdnsp-ep0.c
> +++ b/drivers/usb/cdns3/cdnsp-ep0.c
> @@ -137,10 +137,8 @@ int cdnsp_status_stage(struct cdnsp_device *pdev)
>   return cdnsp_ep_enqueue(pdev->ep0_preq.pep, >ep0_preq);
>  }
>  
> -static int cdnsp_w_index_to_ep_index(__le32  wIndex)
> +static int cdnsp_w_index_to_ep_index(u16 wIndex)
>  {
> - wIndex = le32_to_cpu(wIndex);
> -
>   if (!(wIndex & USB_ENDPOINT_NUMBER_MASK))
>   return 0;
>  
> @@ -176,7 +174,8 @@ static int cdnsp_ep0_handle_status(struct cdnsp_device 
> *pdev,
>*/
>   return cdnsp_ep0_delegate_req(pdev, ctrl);
>   case USB_RECIP_ENDPOINT:
> - pep = >eps[cdnsp_w_index_to_ep_index(ctrl->wIndex)];
> + ep_sts = cdnsp_w_index_to_ep_index(le16_to_cpu(ctrl->wIndex));
> + pep = >eps[ep_sts];
>   ep_sts = GET_EP_CTX_STATE(pep->out_ctx);
>  
>   /* check if endpoint is stalled */
> @@ -305,10 +304,10 @@ static int cdnsp_ep0_handle_feature_endpoint(struct 
> cdnsp_device *pdev,
>int set)
>  {
>