-
Notifications
You must be signed in to change notification settings - Fork 1.5k
mmcsd: fix a logic error #13528
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
mmcsd: fix a logic error #13528
Conversation
|
[Experimental Bot, please feedback here] The provided PR summary does not meet the NuttX requirements. Here's why and what's missing: What's Missing & How to Improve:
Example of an Improved Summary: [logs showing the issue before the fix, e.g., SD card initialization failure] [logs showing successful SD card initialization and operation] Remember: Tailor this example to your specific PR, providing accurate and detailed information. |
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
pkarashchenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary
When attempting to assign a value greater than 1 to a 1-bit bit-field, the result is undefined.
On many systems, this may cause the value to be truncated, keeping only the least significant bit.
In this specific case, the result of scr[0] & 2 is 2 (binary 10), but only the least significant bit (0) will be stored
Impact
mmcsd
Testing
NA