On 02/06/2017 05:59 PM, David Miller wrote:
> Sure but what about these "can_rx_offload_le()" comparisons?

This is to scan the mailboxes according to priority. On some CAN IP
cores the mailboxes decrease in priority (0=high, 63=low) some increase
(63=high, 0=low). The can_rx_offload_le() (le means less or equal) and
can_rx_offload_inc() functions are used to abstract the order. We always
only scan from highest to lower prio (offload->mb_first ...
offload->mb_last):

>       for (i = offload->mb_first;
>            can_rx_offload_le(offload, i, offload->mb_last);
>            can_rx_offload_inc(offload, &i)) {

So we never wrap around.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to