The code 'ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name));' is unnecessary;
And, the following code : 1.has the same functionality; 2.includes error checking; Signed-off-by: Andrew.Yuan <andrew.y...@jaguarmicro.com> --- accel/accel-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/accel-system.c b/accel/accel-system.c index f6c947dd82..5d502c8fd8 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -73,7 +73,7 @@ void accel_system_init_ops_interfaces(AccelClass *ac) g_assert(ac_name != NULL); ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name); - ops = ACCEL_OPS_CLASS(module_object_class_by_name(ops_name)); + oc = module_object_class_by_name(ops_name); if (!oc) { error_report("fatal: could not load module for type '%s'", ops_name); -- 2.37.0.windows.1