HomeFreeBSD

first step towards enforcing must-succeed semantics for bus accessors

Description

first step towards enforcing must-succeed semantics for bus accessors

Unlike BUS_READ_IVAR / BUS_WRITE_IVAR, bus accessors do not have a
return code. It is assumed that there is a tight coupling between a bus
driver and a driver for a device on the bus with respect to instance
variables that the bus defines for its children. So, the driver is
supposed to have only valid accesses to the variables and, thus, the
accessors must always succeed.

Of course, programming errors sometimes happen. At present, such errors
go completely unnoticed. The idea of this change is to start catching
them. As a first step, there will be a warning about a failed accessor
call. This is to give developers a heads-up. I plan to replace the
printf with a KASSERT a week later, so that the warning is harder to
ignore.

Reviewed by: cem, imp, ian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20458