[Bug 769] Minor boundary bug in rtems_io_register_driver
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Tue Aug 5 16:05:56 UTC 2008
http://www.rtems.org/bugzilla/show_bug.cgi?id=769
Joel Sherrill <joel.sherrill at oarcorp.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |WAITING
AssignedTo|joel.sherrill at oarcorp.com |chrisj at rtems.org
Status|ASSIGNED |NEW
Platform| |All
Target Milestone|--- |4.9
Is the check where it returns RTEMS_TOO_MANY a boundary error in
rtems_io_register_driver (cpukit/sapi/src/io.c), or is there something behind
the scenes that means the code is correct but it needs a comment?
You've counted down to zero, and it appears the slot at zero is empty so you
could use it, but the code returns RTEMS_TOO_MANY. I think you want to use
that slot in that case.
Release:
4.6.99
Environment:
All
--- Comment #1 from dufault at hda.com 2005-02-26 08:37:18 ---
Fix:
Use the slot if it is available.
--- Comment #2 from Joel Sherrill <joel.sherrill at oarcorp.com> 2005-03-17 08:38:20 ---
State-Changed-From-To: open->feedback
State-Changed-Why: RTEMS generally reserves 0 since it is easy to accidentally
use 0 by accident. The index portion of an ID is not
allowed to be 0 either which leaves the 0th slot of the
object pointer tables wasted.
It may be a bug in register device to let you do this.
--- Comment #3 from Joel Sherrill <joel.sherrill at oarcorp.com> 2008-08-05 11:05:56 ---
Chris, what do you think of this? Would we be better off searching for an
empty slot from 0 up to the max?
--
Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the bugs
mailing list