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

drivers/sensor: lps25hb: Fix int32 overflow in the val2 part #72681

Merged
merged 1 commit into from
May 15, 2024

Conversation

avisconti
Copy link
Collaborator

@avisconti avisconti commented May 13, 2024

The val2 calculation was done using (1000000 / 40960) as multiplying factor, which was sometimes leading to a int32 overflow. So, let's use the equivalent (but smaller) (3125 / 128).

Fix #46615
Mimic what already done in #38090 (c3050a5)

The val2 calculation was done using (1000000 / 40960) as
multiplying factor, which was sometimes leading to a
int32 overflow. So, let's use the equivalent (but smaller)
(3125 / 128).

Fix zephyrproject-rtos#46615

Signed-off-by: Armando Visconti <armando.visconti@st.com>
@avisconti avisconti added bug The issue is a bug, or the PR is fixing a bug area: Drivers area: Sensors Sensors labels May 13, 2024
@avisconti avisconti self-assigned this May 13, 2024
@aescolar aescolar merged commit 8e13268 into zephyrproject-rtos:main May 15, 2024
28 checks passed
@avisconti avisconti deleted the fix-46615 branch May 15, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Drivers area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drivers: lps25hb driver returning wrong fractional part of a pressure
5 participants