-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: sensor: adi: fix build warnings in ADXL decoder drivers #99405
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
base: main
Are you sure you want to change the base?
drivers: sensor: adi: fix build warnings in ADXL decoder drivers #99405
Conversation
|
Hello @Dilip-Raman, and thank you very much for your first pull request to the Zephyr project! |
|
Please fix the compliance issue (DCO signed-off needs a full name). The other compliance issues are on |
Fix invalid pointer-to-integer cast and comparison warnings in ADXL362, ADXL367, and ADXL372 decoder drivers. The previous code used `(uint8_t *)*fit` for offset comparison, which triggered `-Wint-to-pointer-cast` warnings on recent compilers and could lead to undefined behavior. This patch replaces unsafe casts with `uintptr_t` arithmetic and ensures type-safe offset calculations, preserving existing logic while eliminating all build warnings. Signed-off-by: Dilip Raman <[email protected]>
7a12829 to
82786ed
Compare
|
Please review it. I changed the (DCO signed-off needs a full name). |
Compliance passes, make sure to mark it ready for review to pull in the maintainers. |



Fix invalid pointer-to-integer cast and comparison warnings in ADXL362, ADXL367, and ADXL372 decoder drivers. The previous code used
(uint8_t *)*fitfor offset comparison, which triggered-Wint-to-pointer-castwarnings on recent compilers and could lead to undefined behavior.This patch replaces unsafe casts with
uintptr_tarithmetic and ensures type-safe offset calculations, preserving existing logic while eliminating all build warnings.