Skip to content

[PW_SID:1064974] riscv: uaccess: fix sparse warning about cast to restricted type#1592

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1064974
Closed

[PW_SID:1064974] riscv: uaccess: fix sparse warning about cast to restricted type#1592
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1064974

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1064974 applied to workflow__riscv__fixes

Name: riscv: uaccess: fix sparse warning about cast to restricted type
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1064974
Version: 1

It seems recent changes have made sparse warning about casting to
restricted types whe using __get_user() in drivers such as the
drivers/pci/proc.c.

Fix this with a __force to fix such warnings as:

drivers/pci/proc.c:148:17: warning: cast to restricted __le16
drivers/pci/proc.c:148:17: warning: cast to restricted __le16
drivers/pci/proc.c:148:17: warning: cast to restricted __le16
drivers/pci/proc.c:148:17: warning: cast to restricted __le16
drivers/pci/proc.c:157:17: warning: cast to restricted __le32
drivers/pci/proc.c:157:17: warning: cast to restricted __le32
drivers/pci/proc.c:157:17: warning: cast to restricted __le32
drivers/pci/proc.c:157:17: warning: cast to restricted __le32
drivers/pci/proc.c:166:17: warning: cast to restricted __le16
drivers/pci/proc.c:166:17: warning: cast to restricted __le16
drivers/pci/proc.c:166:17: warning: cast to restricted __le16
drivers/pci/proc.c:166:17: warning: cast to restricted __le16

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2202.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2963.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.74 seconds
Result: WARNING
Output:

WARNING: A patch subject line should describe the change not the tool that found it
#4: 
Subject: [PATCH] riscv: uaccess: fix sparse warning about cast to restricted

WARNING: 'whe' may be misspelled - perhaps 'when'?
#8: 
restricted types whe using __get_user() in drivers such as the
                 ^^^

total: 0 errors, 2 warnings, 0 checks, 8 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit ef10332d69f1 ("riscv: uaccess: fix sparse warning about cast to restricted type") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 2 warnings, 0 checks, 8 lines checked
WARNING: 'whe' may be misspelled - perhaps 'when'?
WARNING: A patch subject line should describe the change not the tool that found it


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
kdoc
Desc: Detects for kdoc errors
Duration: 0.93 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: uaccess: fix sparse warning about cast to restricted type"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1064974 branch March 19, 2026 01:28
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