Ok, the whole point of the CYG_CHECK is to protect programmers from
themselves. And I agree tat the first check might not be necessary. But
I am trying to get my i386-pc ide driver working on a different machine
than my usual target. I am testing it with fs/fat/fileio1.c. If the
mount fails, (which it currently is on my hardware), and you try and
getcwd, you will get a SIGILL because mte->fs is null. (I originally
thought the roblem was that mte was NULL, that is the reason the first
is in there.) So I think there is value in the second check, but if you
insist on removing the first, I am ok with that.
Humm. I would say you are actually checking in the wrong place. The
root problem here is that mount() failed. That probably means
virtually every other filesystem system call will then fail in some
way or other. Picking out just getcwd() for a test is not particularly
robust since most people will actually call open() next. I would say
the assert really belongs in your application checking the return code
from mount. If i were going to add an assert for mts->fs i would make
it part of LOCK_FS().