Hi folks,
I’ve noticed that there are quite a lot of Flash “protect” callbacks
that don’t actually do anything to the hardware. Some of them just loop
through and set the “is_protected” values; one of them (pic32mx)
doesn’t even do that, it does literally nothing and then returns
ERROR_OK. The psoc6 one does nothing and returns ERROR_OK, but prints a
LOG_WARN saying it’s not supported.

This all seems wrong to me. None of them are actually doing any
protecting of the Flash. In my opinion, none of them should return
ERROR_OK; I think they should all be deleted so that attempts to use
them will take the NULL-check path in “flash_driver_protect”, print an
error message, and return ERROR_FLASH_OPER_UNSUPPORTED, a sane value.

Leaving them as is, in my opinion, is just misleading to the user, who
*thinks* they’re doing some sort of protection when they really aren’t.
It’s especially egregious for hardware that *has* protection capability
but where the OpenOCD driver hasn’t implemented it (the user would
expect that the “protect” command, if it succeeds, has activated that
capability), but seems silly also for hardware that doesn’t have that
capability at all.

Thoughts?
-- 
Christopher Head

Attachment: pgpxyn89RSHks.pgp
Description: OpenPGP digital signature

_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to