Skip to content

nvme/util: fix sparse error#56

Open
iomartin wants to merge 2 commits into
SamsungDS:mainfrom
Eideticom:martin/sparse_error
Open

nvme/util: fix sparse error#56
iomartin wants to merge 2 commits into
SamsungDS:mainfrom
Eideticom:martin/sparse_error

Conversation

@iomartin
Copy link
Copy Markdown

Sparse started throwing this error:

../src/nvme/util.c:180:52: warning: cast from restricted leint64_t [usertype] *__prplist
../src/nvme/util.c:180:38: warning: cast to restricted leint64_t [usertype] *

Fix by casting to uintptr_t.

Fixes: 6763e31 ("nvme/util: support multi-page prplists in PRP")

@lsgunth
Copy link
Copy Markdown

lsgunth commented Apr 30, 2026

We found and fixed a couple more sparse issues in the iopf example that get detected when iommufd is enabled.

lsgunth added 2 commits May 7, 2026 16:29
Sparse warns:

  ../examples/iopf.c:46:24: warning: symbol 'pdev' was not declared.
				     Should it be static?

Fix this warning by making pdev static.

Signed-off-by: Logan Gunthorpe <logan.gunthorpe@eideticom.com>
Sparse reports several warnings in iopf:

../examples/iopf.c:92:42: warning: incorrect type in argument 2
../examples/iopf.c:92:42:    expected restricted leint64_t [usertype] v
../examples/iopf.c:92:42:    got unsigned long [usertype] iova
../examples/iopf.c:93:38: warning: incorrect type in argument 2
../examples/iopf.c:93:38:    expected restricted leint32_t [usertype] v
../examples/iopf.c:93:38:    got int
../examples/iopf.c:109:27: warning: restricted leint32_t degrades to integer
../examples/iopf.c:114:38: warning: incorrect type in argument 2
../examples/iopf.c:114:38:    expected restricted leint32_t [usertype] v
../examples/iopf.c:114:38:    got int
../examples/iopf.c:116:27: warning: restricted leint32_t degrades to integer

Fix these by adding proper cpu_to_lexx() and lexx_to_cpu() conversions.

Signed-off-by: Logan Gunthorpe <logan.gunthorpe@eideticom.com>
@lsgunth lsgunth force-pushed the martin/sparse_error branch from 0cfb976 to 7897a12 Compare May 7, 2026 22:30
@lsgunth
Copy link
Copy Markdown

lsgunth commented May 7, 2026

We've rebased this onto the current master which drops the first patch that fixed an issue in he code that was reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants