RTEMS | cpukit/dev/can/can-bittiming.c: Do not use abs() on unsigned values (!726)
Pavel Pisa (@ppisa)
gitlab at rtems.org
Fri Sep 19 22:23:22 UTC 2025
Pavel Pisa started a new discussion on cpukit/dev/can/can-bittiming.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/726#note_132800
> }
>
> bitrate = chip->freq / ( brp * tsegall );
> - bitrate_error = abs( bt->bitrate - bitrate );
> + bitrate_error = bt->bitrate - bitrate;
```
bitrate_error = bt->bitrate > bitrate?
bt->bitrate - bitrate:
bitrate - bt->bitrate;
```
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/726#note_132800
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/20250919/a99bc74f/attachment.htm>
More information about the bugs
mailing list