From patchwork Tue Jun 11 01:35:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenbaodong X-Patchwork-Id: 10985757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B17771398 for ; Tue, 11 Jun 2019 01:38:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A103228623 for ; Tue, 11 Jun 2019 01:38:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9396528685; Tue, 11 Jun 2019 01:38:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E98528623 for ; Tue, 11 Jun 2019 01:38:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1haVho-0004Yq-JR; Tue, 11 Jun 2019 01:36:08 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1haVhn-0004Yl-QV for xen-devel@lists.xenproject.org; Tue, 11 Jun 2019 01:36:07 +0000 X-Inumbo-ID: 46562782-8be9-11e9-8980-bc764e045a96 Received: from mxnavi-mail.mxnavi.com (unknown [116.90.87.199]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 46562782-8be9-11e9-8980-bc764e045a96; Tue, 11 Jun 2019 01:36:05 +0000 (UTC) Received: from localhost.localdomain (61.161.186.150) by mxnavi-mail.mxnavi.com (116.90.87.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Tue, 11 Jun 2019 09:32:53 +0800 From: Baodong Chen To: Date: Tue, 11 Jun 2019 09:35:45 +0800 Message-ID: <1560216945-24227-1-git-send-email-chenbaodong@mxnavi.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [61.161.186.150] X-ClientProxiedBy: mxnavi-mail.mxnavi.com (116.90.87.199) To mxnavi-mail.mxnavi.com (116.90.87.199) Subject: [Xen-devel] [PATCH] xen/scheduler: remove 'name' from 'struct scheduler' X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Tim Deegan , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Robert VanVossen , Dario Faggioli , Julien Grall , Josh Whitehead , Meng Xu , Jan Beulich , Baodong Chen Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 'struct scheduler' already has member 'opt_name' and 'sched_id', thus 'name' is a little redundant, so remove it. Signed-off-by: Baodong Chen --- xen/common/sched_arinc653.c | 1 - xen/common/sched_credit.c | 1 - xen/common/sched_credit2.c | 1 - xen/common/sched_null.c | 1 - xen/common/sched_rt.c | 1 - xen/common/schedule.c | 12 ++++++------ xen/include/xen/sched-if.h | 3 +-- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c index a4c6d00..98d6bdd 100644 --- a/xen/common/sched_arinc653.c +++ b/xen/common/sched_arinc653.c @@ -701,7 +701,6 @@ a653sched_adjust_global(const struct scheduler *ops, * The symbol must be visible to the rest of Xen at link time. */ static const struct scheduler sched_arinc653_def = { - .name = "ARINC 653 Scheduler", .opt_name = "arinc653", .sched_id = XEN_SCHEDULER_ARINC653, .sched_data = NULL, diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 7b7facb..220b179 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -2262,7 +2262,6 @@ static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu) } static const struct scheduler sched_credit_def = { - .name = "SMP Credit Scheduler", .opt_name = "credit", .sched_id = XEN_SCHEDULER_CREDIT, .sched_data = NULL, diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 9c1c3b4..1974e0f 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -4076,7 +4076,6 @@ csched2_deinit(struct scheduler *ops) } static const struct scheduler sched_credit2_def = { - .name = "SMP Credit Scheduler rev2", .opt_name = "credit2", .sched_id = XEN_SCHEDULER_CREDIT2, .sched_data = NULL, diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c index c9700f1..4d8a1cc 100644 --- a/xen/common/sched_null.c +++ b/xen/common/sched_null.c @@ -871,7 +871,6 @@ static void null_dump(const struct scheduler *ops) } static const struct scheduler sched_null_def = { - .name = "null Scheduler", .opt_name = "null", .sched_id = XEN_SCHEDULER_NULL, .sched_data = NULL, diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index f1b81f0..e46b2c2 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -1541,7 +1541,6 @@ static void repl_timer_handler(void *data){ } static const struct scheduler sched_rtds_def = { - .name = "SMP RTDS Scheduler", .opt_name = "rtds", .sched_id = XEN_SCHEDULER_RTDS, .sched_data = NULL, diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 86341bc..d5094ba 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -1729,11 +1729,11 @@ void __init scheduler_init(void) { if ( schedulers[i]->global_init && schedulers[i]->global_init() < 0 ) schedulers[i] = NULL; - else if ( !ops.name && !strcmp(schedulers[i]->opt_name, opt_sched) ) + else if ( !ops.opt_name && !strcmp(schedulers[i]->opt_name, opt_sched) ) ops = *schedulers[i]; } - if ( !ops.name ) + if ( !ops.opt_name ) { printk("Could not find scheduler: %s\n", opt_sched); for ( i = 0; i < NUM_SCHEDULERS; i++ ) @@ -1743,15 +1743,15 @@ void __init scheduler_init(void) ops = *schedulers[i]; break; } - BUG_ON(!ops.name); - printk("Using '%s' (%s)\n", ops.name, ops.opt_name); + BUG_ON(!ops.opt_name); + printk("Using scheduler (%s)\n", ops.opt_name); } if ( cpu_schedule_up(0) ) BUG(); register_cpu_notifier(&cpu_schedule_nfb); - printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name); + printk("Using scheduler: (%s)\n", ops.opt_name); if ( SCHED_OP(&ops, init) ) panic("scheduler returned error on init\n"); @@ -1926,7 +1926,7 @@ void schedule_dump(struct cpupool *c) { sched = c->sched; cpus = c->cpu_valid; - printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name); + printk("Scheduler: (%s)\n", sched->opt_name); SCHED_OP(sched, dump_settings); } else diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index 92bc7a0..6e3d952 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -130,8 +130,7 @@ struct task_slice { }; struct scheduler { - char *name; /* full name for this scheduler */ - char *opt_name; /* option name for this scheduler */ + const char *opt_name; /* option name for this scheduler */ unsigned int sched_id; /* ID for this scheduler */ void *sched_data; /* global data pointer */