From patchwork Mon Sep 9 03:17:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andrew.Yuan" X-Patchwork-Id: 13795785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24728CE7AB0 for ; Mon, 9 Sep 2024 03:23:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snUzV-0007DG-TO; Sun, 08 Sep 2024 23:23:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snUzU-00078R-4p for qemu-devel@nongnu.org; Sun, 08 Sep 2024 23:23:00 -0400 Received: from mail-eastasiaazon11020142.outbound.protection.outlook.com ([52.101.128.142] helo=HK2PR02CU002.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snUzR-0008PR-LV for qemu-devel@nongnu.org; Sun, 08 Sep 2024 23:22:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WM1LR3cLQ7nX4lzGxOXpBF/pyWg+xS9uxpPwxRwNcqapC6zOg3SMU13yaT2zasznyTckyZySV5M4tAMqCExZsPU925hh7hPqJxS0op7SN5gE5Q50foDc6l10+XWLA6SiQgRGnasAFCIKw+RBA9dFMQytfdoOV7lNxnp6IYBZUXTH+RfPhuUsRC7GpN019xJFoQlslp6WaqF++hli+aS1yCy7dJ8GnPeDOp0CRnWg7Cnkeh8GHVeHhZBYbS7ZAGDq13ttka6bQIXLH+4R5QM7YrK/m0MhJ+cCz6V02kRU19LomGe6+EvfbVo1YFyeADiPhsrjhTI+4cpLpKRlfQ+9lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VQWzVbAU8B8P11ybTQhKS/+f3xU1Jo16bFN+FLNrXfg=; b=CV3lKNVf/RUXPx4STPso/qZ9gIoxxBfT5QxS3Dggz+OhUGCuzdPmezZIlROB5/kVvLlrja7eUDLpO7lOrz6QVD6mos6qNKAHqO/jKRwZJIBUFb5XC6hFTR/pPr6yRBlCjKKpXIdvI9KH46weIFxxCOl3U3ovqcZmMCvAYQiewaz6QS0xoGEem+99NaIViL/mtQlMRJgMpo15i32V6PZ/wKzwyHGXvCuVhNflXa4JkChl7nr3X4WtnRr9cViMYAsIjo/dkeDHC4djioC+KumZHoyLEpS4Q3t3+rFEV0aecn4sWOMhf+Q20ieTjOdIVGiM6LfLxFJer1uTEc0UxQqDTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VQWzVbAU8B8P11ybTQhKS/+f3xU1Jo16bFN+FLNrXfg=; b=rE7GWd18SD1bRDuurprOW7ybBxy4QOwF67ytAKVO14jAf8MkQNTOySNZi3dSDt34Grd9S7AAMGRNEFFtf5OQ2elzq0m498u/lURBoCiPuJrOcw8ffLHa0ifwMtaLxpE6EmwobXd7SX65YDaOYJdzCJ7hhIBNevb43yvV2dpqHdsnI1mx3Qgtpt7/rvKLEanJGOMFAsLgZCbCfOfJae34nIM/UVaklQB1mOPH4hQ5pHcJiPvaQ/vW+QTgcuagj3c5HLzJxxZbITzk/YogPVZhxAN+OPG4B7JpcnJvrCCX8TRRHeuvjpBu8cN9bBbjw2ItKUfY5JQaRU3dU42ZRdslyg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from KL1PR0601MB4891.apcprd06.prod.outlook.com (2603:1096:820:ae::7) by TYSPR06MB6390.apcprd06.prod.outlook.com (2603:1096:400:433::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.22; Mon, 9 Sep 2024 03:17:44 +0000 Received: from KL1PR0601MB4891.apcprd06.prod.outlook.com ([fe80::8950:42de:2354:91b2]) by KL1PR0601MB4891.apcprd06.prod.outlook.com ([fe80::8950:42de:2354:91b2%4]) with mapi id 15.20.7939.022; Mon, 9 Sep 2024 03:17:44 +0000 From: "Andrew.Yuan" To: philmd@linaro.org, dbarboza@ventanamicro.com, alistair.francis@wdc.com, pbonzini@redhat.com, qemu-devel@nongnu.org Cc: "Andrew.Yuan" Subject: [PATCH] Remove unnecessary code in the interface accel_system_init_ops_interfaces Date: Mon, 9 Sep 2024 11:17:36 +0800 Message-Id: <20240909031736.1881-1-andrew.yuan@jaguarmicro.com> X-Mailer: git-send-email 2.37.0.windows.1 X-ClientProxiedBy: TYCP286CA0140.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::14) To KL1PR0601MB4891.apcprd06.prod.outlook.com (2603:1096:820:ae::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB4891:EE_|TYSPR06MB6390:EE_ X-MS-Office365-Filtering-Correlation-Id: 6bb20e8b-6dd9-4198-3781-08dcd07df89d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: mFp28dJGEsWThBf99xlkHnZHt+tPSDlT5wGhAtzNwzg70XaKUotgXgxw8jhkjN5jzCe0k1clLw67reMKBSU7tj7uGYiW9k+KMP+T9sAu4PvXKgI0zWLmBbKkPhv05AjWhh+MR9mc4vKXit5JoDEq+bx6/wmDxkiNoJdpkFmKQcTC8GOX3LdNufaCHcnEEyq8OKt0uJeoLkr9YGkWyY9cGQuN+3FIS8ORQ7TuIH1L5sHmzeUXg5kYYFRU56/TLO2tsoB8vELatvv2Ye+1lP5tndaTXvjuriRxyeHmNe0ubbUDQJQCHaycPR0qlRNHjZsV3soX7kJEUC+BxhE+6vEtbAbHw4+yjGAALD+zOX3h6B7UotqI9boXZbie7ZaqSIc4Hh3Cz6sr9oZpwAYITeJqD2ksjcsQQjjrHJ963tM/HFYhfTDV8QeyoD/IdXPZfrmNNzvymL3yzjt18ZqU7Trh3KD3xGiQDzphcMVPAwbKb+vMJwEKXia3UtpasETITnrTh7bASX9UycgNmPyeRd6RsO5L8BQFgGOIpGTOJT5tDl3kQzglIBFNGzuqijMBZRknziUY4v2Cw0XgAZKCCv/dc3BSwyuQ1PHnkCidgCKlJdbgRDKCPurpv0+P4o3mdCpJfvdun5h60Gn8IMnFObdV+9fcDFrMX2pAtxx0MxwwblZWhienh+3lKXLTMsNDTo6+L75Xr2wqYzCYrKovUpO6E8RLupa2tKqIBafHu8rEKlN7r4QD0yV5j7dE/mNsuH88lz1soXM6J+Utm4L9JM7pH4EdCT6Xqm+AEsW5+THEJ2/dPaVplxsFCiZvB2VVRZ/w4k3QNV6LtDxRRN/bKd8eWhL7VhCMjw5yYt1oCM32OchfiHycaWRYl2v8rSSWmTbsIrRhoQyClqF3efDSnaelTlWG7Ryw3ynejYEWHPGYqZO3OqkrraznuSSiT0nzigMCUnvpXTTVVapUM6WO5g6A3ji1rlZ2zoPLhOApMOB6Z8tgk41A6KnJIPZkFjIppgiXBZhj9Rl54PMutdZdOf6fcdVi9V+N2H7NjkK6BUfc38VzO3KC3qRIbgAgEHkxh4PIwqYtly5v4gWrFHdlo0HbxAHxv8Vmw12Y5Po4Jpcft4TGkAeg5ZKaL6RxJkCvh4Y5kVKoqgse4uUJlhJS3BVCHUVVtha26MRa8xIZW7dECXnlG6B+Ao2+rr/hxPdpcRx5ql2ZqCZUi65jXLItZbSF7NosyoYu4hlgx2JhBU4BJSvLiTWNylP/Ok9I4KSbVnKbD4WsFYeiMtPKqLI1H1/rUI5o3ckwogbhWraVVGl7UKo6c8XcEU1j9EqRNvvPA81/vajmE4J6rXYGf/IxgV+HjECBYiHfK/8zbYhqPT3LcOBAZQaC0W2YW/x+XOoaWJl1j7NwvZ4I3lHeSFYjXiVRlg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB4891.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: huYaM/2AFABDyMsJvTzuntyXGWrZmBVZt+3QND6PRdo7WcOzyvIVDufDEX/atVChVBXnAtid9rmlnOfMVsowldht+FdJa9GlLlL0n3lK+gxPt3YlQwQpgGxqX815a0EPPVyLEidudLmNQn+PrWqTNSp1hSgTwQQ48yW6ON4MgCrjCiEpDzrU4GPFs54cG2tjgLvpQRD7M2ciQi3x3tmDjDtwjWshl+aG9TqnuX/BI7HyKboyMG/3orI1v/1SpD7Ly1O0Fq0jisUxxTzzdJSDjHivZvxdDvifiEu5FM2Oq05WJTacZ2E9FmPepexCg/jPxTEHNhXNjk2DHmCG1bfsiZYBEYp7zaaajC1HrnR3yP68kDMFIPR81Ap9SaYyA3MzXWnaZppQEn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ui1trhKDEK9EFi79+TllnysTXafoNy/Q++26yiU8/ImfPFpIO31q18DuiwupKSLPgC4xaQ0BExSaIbLG87sZqkUKiw/ayZn4O2mR4IXkvhZd15hcDB4jnLFl1GGOLqBk8rAG+DsJ4SmhoZYD6bi2w== X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bb20e8b-6dd9-4198-3781-08dcd07df89d X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4891.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2024 03:17:44.2491 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PvuUFljpc4ozdFcAGA+SEkqa1f+5cDK63u6KVrVwfFSG/+y3tqC0Xkfr3zNXhtVJmtiI0fl6dwR3xKsLYS5eX9oWp9gYiVgJrh1ARvxBe0c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6390 Received-SPF: pass client-ip=52.101.128.142; envelope-from=andrew.yuan@jaguarmicro.com; helo=HK2PR02CU002.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 Reviewed-by: Claudio Fontana --- 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);