memset(p, 0, sizeof(struct visorchipset_device_info));
}
+static struct visorchipset_bus_info *
+bus_find(struct list_head *list, u32 bus_no)
+{
+ struct visorchipset_bus_info *p;
+
+ list_for_each_entry(p, list, entry) {
+ if (p->bus_no == bus_no)
+ return p;
+ }
+
+ return NULL;
+}
+
static u8
check_chipset_events(void)
{
struct visorchipset_bus_info *p;
bool need_clear = false;
- p = findbus(&bus_info_list, bus_no);
+ p = bus_find(&bus_info_list, bus_no);
if (!p)
return;
u32 cmd, struct controlvm_message_header *msg_hdr,
int response, bool need_response)
{
+ struct visorchipset_bus_info *bus_info;
bool notified = false;
- struct visorchipset_bus_info *bus_info = findbus(&bus_info_list,
- bus_no);
+ bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info)
return;
int rc = CONTROLVM_RESP_SUCCESS;
struct visorchipset_bus_info *bus_info;
- bus_info = findbus(&bus_info_list, bus_no);
+ bus_info = bus_find(&bus_info_list, bus_no);
if (bus_info && (bus_info->state.created == 1)) {
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
POSTCODE_SEVERITY_ERR);
struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
- bus_info = findbus(&bus_info_list, bus_no);
+ bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info)
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
else if (bus_info->state.created == 0)
POSTCODE_LINUX_3(BUS_CONFIGURE_ENTRY_PC, bus_no,
POSTCODE_SEVERITY_INFO);
- bus_info = findbus(&bus_info_list, bus_no);
+ bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info) {
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
goto cleanup;
}
- bus_info = findbus(&bus_info_list, bus_no);
+ bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info) {
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
POSTCODE_SEVERITY_ERR);
bool
visorchipset_get_bus_info(u32 bus_no, struct visorchipset_bus_info *bus_info)
{
- void *p = findbus(&bus_info_list, bus_no);
+ void *p = bus_find(&bus_info_list, bus_no);
if (!p)
return false;
bool
visorchipset_set_bus_context(u32 bus_no, void *context)
{
- struct visorchipset_bus_info *p = findbus(&bus_info_list, bus_no);
+ struct visorchipset_bus_info *p = bus_find(&bus_info_list, bus_no);
if (!p)
return false;