On Fri, Dec 10, 2010 at 4:16 PM, Paul Richards <paulr...@gmail.com> wrote:
> On 2010/12/10 18:46, Spencer Oliver wrote:
>>
>> Not looked into it but why do we not just duplicate the existing
>> unregister event/timer functions - or are they broken aswell?
>>
>
> They (the target versions) don't appear to have the same problem.  The only
> difference I can see is that the jtag_unregister_event_callback() continues
> to look for further events to unregister.  I'm not familiar enough with the
> code to know why that might be possible.  Easy enough to continue iterating
> if it is required.
>
> Now there's 3 versions to choose from :-)  I would have copied these had I
> known they were there.
>

It's not too late. The target versions seems nice and readable. And
correct, as far as I can see this late hour. I think the jtag version
should follow the behavior of these and only remove the first matching
handler. That would be the correct thing to do, if there was a point
in having the same handler registered more than once.

The only issue I have with copying the target version is that having
the same code duplicated in three places probably warrants refactoring
it into a helper function instead.

Regards,
Andreas
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to