Skip to content

[PW_SID:966233] drm: tegra: Fix undefined behavior in left shift operation#444

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

[PW_SID:966233] drm: tegra: Fix undefined behavior in left shift operation#444
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw966233

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 966233 applied to workflow__riscv__fixes

Name: drm: tegra: Fix undefined behavior in left shift operation
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=966233
Version: 1

According to the C11 standard (ISO/IEC 9899:2011, 6.5.7):
"If E1 has a signed type and E1 x 2^E2 is not representable in the result
type, the behavior is undefined."

Shifting 1 << 31 causes signed integer overflow, which leads to undefined
behavior.

Fix this by explicitly using 'BIT(31)' to ensure the shift operates on an
unsigned type, avoiding undefined behavior.

Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 105.62 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 912.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1187.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 68.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
kdoc
Desc: Detects for kdoc errors
Duration: 0.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "drm: tegra: Fix undefined behavior in left shift operation"
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: "drm: tegra: Fix undefined behavior in left shift operation"
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 pw966233 branch May 28, 2025 14:20
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