Wolfgang Grandegger wrote:
>>> Index: ksrc/drivers/can/rtcan_raw_filter.c
>>> ===================================================================
>>> --- ksrc/drivers/can/rtcan_raw_filter.c    (revision 2193)
>>> +++ ksrc/drivers/can/rtcan_raw_filter.c    (working copy)
>>> @@ -55,13 +55,13 @@ void rtcan_raw_print_filter(struct rtcan
>>>  static inline void rtcan_raw_mount_filter(can_filter_t *recv_filter,
>>>                        can_filter_t *filter)
>>>  {
>>> -   if (filter->can_id & CAN_EFF_FLAG)
>>> -    recv_filter->can_mask = ((filter->can_mask & CAN_EFF_MASK) |
>>> -                 CAN_EFF_FLAG);
>>> -    else
>>> -    recv_filter->can_mask = (filter->can_mask & CAN_SFF_MASK);
>>> -
>>> -    recv_filter->can_id = filter->can_id & recv_filter->can_mask;
>>> +    if (filter->can_id & CAN_INV_FILTER) {
>>> +    recv_filter->can_id = filter->can_id & ~CAN_INV_FILTER;
>>> +    recv_filter->can_mask = filter->can_mask | CAN_INV_FILTER;
>>> +    } else {
>>> +    recv_filter->can_id = filter->can_id;
>>> +    recv_filter->can_mask = filter->can_mask & ~CAN_INV_FILTER;
>>> +    }
>>
>> Why do you push CAN_INV_FILTER internally into the mask instead of
>> keeping it in the filter's ID - as the pseudo code above states?
> 
> To simplify the filter calculation. It actually avoids the expression
> (filter->can_id & ~CAN_INV_FILTER). As this is in a very frequently
> called function, I think it's worth the trick.
> 

Ack. I missed that point on first run.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to