Pavel Pisa commented on a discussion on cpukit/include/dev/can/can-queue.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/49#note_108466 > +#define CAN_FIFOF_NOTIFYPEND ( 1 << 4 ) > +#define CAN_FIFOF_RTL_MEM ( 1 << 3 ) > + > +/** > + * @brief This function atomically tests FIFO flag to input flag. > + * > + * @param fifo Pointer to CAN FIFO Queue. > + * @param flag Required flag to be tested. > + * > + * @return True if FIFO has the flag. > + * @return False otherwise. > + * > + */ > +static inline int canque_fifo_test_fl( struct canque_fifo_t *fifo, int flag > ) > +{ > + return ( atomic_load( &fifo->fifo_flags ) &flag ) ? 1 : 0; It could be problematic if int is shorter than fifo_flags. Then ternary is safe option. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/49#note_108466 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
