RTEMS | bsps/powerpc: Address -Wsign-compare warnings (!1009)
Joel Sherrill (@joel)
gitlab at rtems.org
Thu Feb 5 14:57:11 UTC 2026
Joel Sherrill commented on a discussion on bsps/powerpc/tqm8xx/spi/spi.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1009#note_141572
> #if defined(DEBUG)
> printk("... exit OK, rc=%d\r\n",bc);
> #endif
> - return (rc == RTEMS_SUCCESSFUL) ? bc : -rc;
> + if (rc == RTEMS_SUCCESSFUL) {
> + return bc;
> + }
> + return -rc;
Yes. There were a few inline conditionals like this where rc (enum rtems_status_code) is checked and either an integer or negative rtems_status_code is returned. Breaking it apart addressed these sign-compare warnings without adding any csats.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1009#note_141572
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/20260205/2c42fde5/attachment.htm>
More information about the bugs
mailing list