Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

includes: explicit cast of destination bitwidth of left shift #71856

Conversation

DeHess
Copy link
Collaborator

@DeHess DeHess commented Apr 24, 2024

Fix coding guideline MISRA C:2012 Rule 12.2:

The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand.

This PR is part of the enhancement issue (#48002) which port the coding guideline fixes done by BUGSENG on the https://github.com/zephyrproject-rtos/zephyr/tree/v2.7-auditable-branch back to main

- explicit with a cast the destination bitwidth of left shift
  ensuring to not break DTS

Signed-off-by: Abramo Bagnara <[email protected]>
@zephyrbot zephyrbot added the area: Devicetree Binding PR modifies or adds a Device Tree binding label Apr 24, 2024
@zephyrbot zephyrbot requested review from decsny and galak April 24, 2024 09:11
Copy link

Hello @DeHess, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@simhein simhein added the area: Coding Guidelines Coding guidelines and style label Apr 24, 2024
@DeHess DeHess changed the title coding guidelines: comply with MISRA C:2012 Rule 12.2 includes: explicit cast of destination bitwidth of left shift Apr 30, 2024
@nashif nashif merged commit 47896e4 into zephyrproject-rtos:main May 1, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Coding Guidelines Coding guidelines and style area: Devicetree Binding PR modifies or adds a Device Tree binding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants