Re: drivers/fwctl/pds/main.c:113:65: sparse: sparse: restricted __le32 degrades to integer

Jason Gunthorpe
2025-04-02T12:28:34Z

On Wed, Apr 02, 2025 at 02:46:38AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 08733088b566b58283f0f12fb73f5db6a9a9de30
> commit: 92c66ee829b99a860a90f62ef16df3e42f92edac pds_fwctl: add rpc and query support
> date: 11 days ago
> config: loongarch-randconfig-r111-20250401 (https://download.01.org/0day-ci/archive/20250402/202504020246.Dfbhxoo9-lkp@intel.com/config)
> compiler: loongarch64-linux-gcc (GCC) 14.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20250402/202504020246.Dfbhxoo9-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202504020246.Dfbhxoo9-lkp@intel.com/

Shannon, can you send a patch to fix all the sparse errors?

Thanks

> sparse warnings: (new ones prefixed by >>)
> >> drivers/fwctl/pds/main.c:113:65: sparse: sparse: restricted __le32 degrades to integer
> >> drivers/fwctl/pds/main.c:202:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] endpoint @@ got restricted __le32 [usertype] id @@
> drivers/fwctl/pds/main.c:202:50: sparse: expected unsigned int [usertype] endpoint
> drivers/fwctl/pds/main.c:202:50: sparse: got restricted __le32 [usertype] id
> drivers/fwctl/pds/main.c:250:29: sparse: sparse: restricted __le32 degrades to integer
> drivers/fwctl/pds/main.c:288:39: sparse: sparse: restricted __le32 degrades to integer
> drivers/fwctl/pds/main.c:294:40: sparse: sparse: restricted __le32 degrades to integer
> drivers/fwctl/pds/main.c:300:41: sparse: sparse: restricted __le32 degrades to integer
> drivers/fwctl/pds/main.c:329:44: sparse: sparse: restricted __le32 degrades to integer
> >> drivers/fwctl/pds/main.c:330:21: sparse: sparse: cast to restricted __le32
> drivers/fwctl/pds/main.c:330:21: sparse: sparse: restricted __le32 degrades to integer
> drivers/fwctl/pds/main.c:330:21: sparse: sparse: restricted __le32 degrades to integer
> >> drivers/fwctl/pds/main.c:330:21: sparse: sparse: cast to restricted __le32
> drivers/fwctl/pds/main.c:330:21: sparse: sparse: restricted __le32 degrades to integer
> drivers/fwctl/pds/main.c:330:21: sparse: sparse: restricted __le32 degrades to integer
> >> drivers/fwctl/pds/main.c:405:56: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le16 [usertype] flags @@ got int @@
> drivers/fwctl/pds/main.c:405:56: sparse: expected restricted __le16 [usertype] flags
> drivers/fwctl/pds/main.c:405:56: sparse: got int