sgi-xp: Use designated initializers
Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. In this case, no initializers are needed (they can be NULL initialized and callers adjusted to check for NULL, which is more efficient than an indirect call). Cc: Robin Holt <robinmholt@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Christoph Hellwig <hch@infradead.org>
This commit is contained in:
@@ -309,6 +309,9 @@ static inline enum xp_retval
|
||||
xpc_send(short partid, int ch_number, u32 flags, void *payload,
|
||||
u16 payload_size)
|
||||
{
|
||||
if (!xpc_interface.send)
|
||||
return xpNotLoaded;
|
||||
|
||||
return xpc_interface.send(partid, ch_number, flags, payload,
|
||||
payload_size);
|
||||
}
|
||||
@@ -317,6 +320,9 @@ static inline enum xp_retval
|
||||
xpc_send_notify(short partid, int ch_number, u32 flags, void *payload,
|
||||
u16 payload_size, xpc_notify_func func, void *key)
|
||||
{
|
||||
if (!xpc_interface.send_notify)
|
||||
return xpNotLoaded;
|
||||
|
||||
return xpc_interface.send_notify(partid, ch_number, flags, payload,
|
||||
payload_size, func, key);
|
||||
}
|
||||
@@ -324,12 +330,16 @@ xpc_send_notify(short partid, int ch_number, u32 flags, void *payload,
|
||||
static inline void
|
||||
xpc_received(short partid, int ch_number, void *payload)
|
||||
{
|
||||
return xpc_interface.received(partid, ch_number, payload);
|
||||
if (xpc_interface.received)
|
||||
xpc_interface.received(partid, ch_number, payload);
|
||||
}
|
||||
|
||||
static inline enum xp_retval
|
||||
xpc_partid_to_nasids(short partid, void *nasids)
|
||||
{
|
||||
if (!xpc_interface.partid_to_nasids)
|
||||
return xpNotLoaded;
|
||||
|
||||
return xpc_interface.partid_to_nasids(partid, nasids);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user