spapr: Abolish DRC set_configured method
DRConnectorClass has a set_configured method, however: * There is only one implementation, and only ever likely to be one * There's exactly one caller, and that's (now) local * The implementation is very straightforward So abolish the method entirely, and just open-code what we need. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Tested-by: Daniel Barboza <danielhb@linux.vnet.ibm.com>
This commit is contained in:
		
							parent
							
								
									88af6ea568
								
							
						
					
					
						commit
						4f65ce00ab
					
				@ -199,18 +199,6 @@ static const char *get_name(sPAPRDRConnector *drc)
 | 
				
			|||||||
    return drc->name;
 | 
					    return drc->name;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void set_configured(sPAPRDRConnector *drc)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    trace_spapr_drc_set_configured(get_index(drc));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_UNISOLATED) {
 | 
					 | 
				
			||||||
        /* guest should be not configuring an isolated device */
 | 
					 | 
				
			||||||
        trace_spapr_drc_set_configured_skipping(get_index(drc));
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    drc->configured = true;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* has the guest been notified of device attachment? */
 | 
					/* has the guest been notified of device attachment? */
 | 
				
			||||||
static void set_signalled(sPAPRDRConnector *drc)
 | 
					static void set_signalled(sPAPRDRConnector *drc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -745,7 +733,6 @@ static void spapr_dr_connector_class_init(ObjectClass *k, void *data)
 | 
				
			|||||||
    drck->get_index = get_index;
 | 
					    drck->get_index = get_index;
 | 
				
			||||||
    drck->get_type = get_type;
 | 
					    drck->get_type = get_type;
 | 
				
			||||||
    drck->get_name = get_name;
 | 
					    drck->get_name = get_name;
 | 
				
			||||||
    drck->set_configured = set_configured;
 | 
					 | 
				
			||||||
    drck->entity_sense = entity_sense;
 | 
					    drck->entity_sense = entity_sense;
 | 
				
			||||||
    drck->attach = attach;
 | 
					    drck->attach = attach;
 | 
				
			||||||
    drck->detach = detach;
 | 
					    drck->detach = detach;
 | 
				
			||||||
@ -1113,7 +1100,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
 | 
				
			|||||||
    uint64_t wa_offset;
 | 
					    uint64_t wa_offset;
 | 
				
			||||||
    uint32_t drc_index;
 | 
					    uint32_t drc_index;
 | 
				
			||||||
    sPAPRDRConnector *drc;
 | 
					    sPAPRDRConnector *drc;
 | 
				
			||||||
    sPAPRDRConnectorClass *drck;
 | 
					 | 
				
			||||||
    sPAPRConfigureConnectorState *ccs;
 | 
					    sPAPRConfigureConnectorState *ccs;
 | 
				
			||||||
    sPAPRDRCCResponse resp = SPAPR_DR_CC_RESPONSE_CONTINUE;
 | 
					    sPAPRDRCCResponse resp = SPAPR_DR_CC_RESPONSE_CONTINUE;
 | 
				
			||||||
    int rc;
 | 
					    int rc;
 | 
				
			||||||
@ -1133,7 +1119,6 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
 | 
				
			|||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
 | 
					 | 
				
			||||||
    if (!drc->fdt) {
 | 
					    if (!drc->fdt) {
 | 
				
			||||||
        trace_spapr_rtas_ibm_configure_connector_missing_fdt(drc_index);
 | 
					        trace_spapr_rtas_ibm_configure_connector_missing_fdt(drc_index);
 | 
				
			||||||
        rc = SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE;
 | 
					        rc = SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE;
 | 
				
			||||||
@ -1170,10 +1155,17 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
 | 
				
			|||||||
        case FDT_END_NODE:
 | 
					        case FDT_END_NODE:
 | 
				
			||||||
            ccs->fdt_depth--;
 | 
					            ccs->fdt_depth--;
 | 
				
			||||||
            if (ccs->fdt_depth == 0) {
 | 
					            if (ccs->fdt_depth == 0) {
 | 
				
			||||||
 | 
					                sPAPRDRIsolationState state = drc->isolation_state;
 | 
				
			||||||
                /* done sending the device tree, don't need to track
 | 
					                /* done sending the device tree, don't need to track
 | 
				
			||||||
                 * the state anymore
 | 
					                 * the state anymore
 | 
				
			||||||
                 */
 | 
					                 */
 | 
				
			||||||
                drck->set_configured(drc);
 | 
					                trace_spapr_drc_set_configured(get_index(drc));
 | 
				
			||||||
 | 
					                if (state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) {
 | 
				
			||||||
 | 
					                    drc->configured = true;
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    /* guest should be not configuring an isolated device */
 | 
				
			||||||
 | 
					                    trace_spapr_drc_set_configured_skipping(get_index(drc));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                spapr_ccs_remove(spapr, ccs);
 | 
					                spapr_ccs_remove(spapr, ccs);
 | 
				
			||||||
                ccs = NULL;
 | 
					                ccs = NULL;
 | 
				
			||||||
                resp = SPAPR_DR_CC_RESPONSE_SUCCESS;
 | 
					                resp = SPAPR_DR_CC_RESPONSE_SUCCESS;
 | 
				
			||||||
 | 
				
			|||||||
@ -177,9 +177,6 @@ typedef struct sPAPRDRConnectorClass {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *state);
 | 
					    uint32_t (*entity_sense)(sPAPRDRConnector *drc, sPAPRDREntitySense *state);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* QEMU interfaces for managing FDT/configure-connector */
 | 
					 | 
				
			||||||
    void (*set_configured)(sPAPRDRConnector *drc);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* QEMU interfaces for managing hotplug operations */
 | 
					    /* QEMU interfaces for managing hotplug operations */
 | 
				
			||||||
    void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
 | 
					    void (*attach)(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
 | 
				
			||||||
                   int fdt_start_offset, bool coldplug, Error **errp);
 | 
					                   int fdt_start_offset, bool coldplug, Error **errp);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user