RTEMS | cpukit/dev/can/can-bittiming.c: remove calls to abs() (!738)
Michal Lenc (@michallenc)
gitlab at rtems.org
Sat Sep 20 19:00:21 UTC 2025
Michal Lenc created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/738
Project:Branches: michallenc/rtems:can-bittiming-remove-abs to rtems/rtos/rtems:main
Author: Michal Lenc
## Summary
cpukit/dev/can/can-bittiming.c: remove calls to abs()
Using `abs()` on unsigned integers leads to GCC warning -Wabsolute-value.
This commit removes the calls to `abs()` and replaces them with ternary
conditional operator. This keeps the correct error calculation
previously ensured by `abs()` call.
Solution as suggested in !726
<!-- Default settings, if it is a dropdown it will set after submission -->
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/738
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250920/d6002b70/attachment.htm>
More information about the bugs
mailing list