All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kubascik <jeff.kubascik@dornerworks.com>
To: xen-devel@lists.xenproject.org
Cc: xen-devel@dornerworks.com,
	Josh Whitehead <josh.whitehead@dornerworks.com>,
	Stewart Hildebrand <stewart.hildebrand@dornerworks.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Jeff Kubascik <jeff.kubascik@dornerworks.com>
Subject: [PATCH 2/5] sched/arinc653: Rename scheduler private structs
Date: Wed, 16 Sep 2020 14:18:51 -0400	[thread overview]
Message-ID: <20200916181854.75563-3-jeff.kubascik@dornerworks.com> (raw)
In-Reply-To: <20200916181854.75563-1-jeff.kubascik@dornerworks.com>

The arinc653 module uses typedef struct with post fix tags for internal
structure definitions, which is not consistent with the Xen coding
style. This change cleans up the code to better match the style used
elsewhere in the Xen scheduler code, and has no functional changes.

Signed-off-by: Jeff Kubascik <jeff.kubascik@dornerworks.com>
---
 xen/common/sched/arinc653.c | 42 ++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index 7bb75ffe2b..d8a23730c3 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -50,38 +50,38 @@
  * Return a pointer to the ARINC 653-specific scheduler data information
  * associated with the given UNIT
  */
-#define AUNIT(unit) ((arinc653_unit_t *)(unit)->priv)
+#define AUNIT(unit) ((struct a653sched_unit *)(unit)->priv)
 
 /*
  * Return the global scheduler private data given the scheduler ops pointer
  */
-#define SCHED_PRIV(s) ((a653sched_priv_t *)((s)->sched_data))
+#define SCHED_PRIV(s) ((struct a653sched_private *)((s)->sched_data))
 
 /*
  * Schedule unit
  */
-typedef struct arinc653_unit_s
+struct a653sched_unit
 {
     struct sched_unit *unit;            /* Up-pointer to UNIT */
     bool awake;                         /* UNIT awake flag */
     struct list_head list;              /* On the scheduler private data */
-} arinc653_unit_t;
+};
 
 /*
  * Domain frame entry in the ARINC 653 schedule
  */
-typedef struct sched_entry_s
+struct sched_entry
 {
     xen_domain_handle_t dom_handle;     /* UUID of the domain */
     int unit_id;                        /* UNIT number for reference */
     s_time_t runtime;                   /* Duration of the frame */
     struct sched_unit *unit;            /* Pointer to UNIT */
-} sched_entry_t;
+};
 
 /*
  * Scheduler private data
  */
-typedef struct a653sched_priv_s
+struct a653sched_private
 {
     spinlock_t lock;                    /* Scheduler private lock */
 
@@ -93,7 +93,7 @@ typedef struct a653sched_priv_s
      * and UNIT number match, then the UNIT is allowed to run. Its run time
      * (per major frame) is given in the third entry of the schedule.
      */
-    sched_entry_t schedule[ARINC653_MAX_DOMAINS_PER_SCHEDULE];
+    struct sched_entry schedule[ARINC653_MAX_DOMAINS_PER_SCHEDULE];
 
     /*
      * This variable holds the number of entries that are valid in
@@ -110,7 +110,7 @@ typedef struct a653sched_priv_s
     s_time_t next_major_frame;          /* When to switch to the next frame */
 
     struct list_head unit_list;         /* UNITs belonging to this scheduler */
-} a653sched_priv_t;
+};
 
 /* This function compares two domain handles */
 static int dom_handle_cmp(const xen_domain_handle_t h1,
@@ -124,7 +124,7 @@ static struct sched_unit *find_unit(
     xen_domain_handle_t handle,
     int unit_id)
 {
-    arinc653_unit_t *aunit;
+    struct a653sched_unit *aunit;
 
     list_for_each_entry ( aunit, &SCHED_PRIV(ops)->unit_list, list )
         if ( (dom_handle_cmp(aunit->unit->domain->handle, handle) == 0)
@@ -150,7 +150,7 @@ arinc653_sched_set(
     const struct scheduler *ops,
     struct xen_sysctl_arinc653_schedule *schedule)
 {
-    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
+    struct a653sched_private *sched_priv = SCHED_PRIV(ops);
     s_time_t total_runtime = 0;
     unsigned int i;
     unsigned long flags;
@@ -217,7 +217,7 @@ arinc653_sched_get(
     const struct scheduler *ops,
     struct xen_sysctl_arinc653_schedule *schedule)
 {
-    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
+    struct a653sched_private *sched_priv = SCHED_PRIV(ops);
     unsigned int i;
     unsigned long flags;
 
@@ -242,9 +242,9 @@ arinc653_sched_get(
 static int
 a653sched_init(struct scheduler *ops)
 {
-    a653sched_priv_t *prv;
+    struct a653sched_private *prv;
 
-    prv = xzalloc(a653sched_priv_t);
+    prv = xzalloc(struct a653sched_private);
     if ( prv == NULL )
         return -ENOMEM;
 
@@ -268,8 +268,8 @@ static void *
 a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
                       void *dd)
 {
-    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
-    arinc653_unit_t *svc;
+    struct a653sched_private *sched_priv = SCHED_PRIV(ops);
+    struct a653sched_unit *svc;
     unsigned int entry;
     unsigned long flags;
 
@@ -277,7 +277,7 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
      * Allocate memory for the ARINC 653-specific scheduler data information
      * associated with the given UNIT (unit).
      */
-    svc = xmalloc(arinc653_unit_t);
+    svc = xmalloc(struct a653sched_unit);
     if ( svc == NULL )
         return NULL;
 
@@ -323,8 +323,8 @@ a653sched_alloc_udata(const struct scheduler *ops, struct sched_unit *unit,
 static void
 a653sched_free_udata(const struct scheduler *ops, void *priv)
 {
-    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
-    arinc653_unit_t *av = priv;
+    struct a653sched_private *sched_priv = SCHED_PRIV(ops);
+    struct a653sched_unit *av = priv;
     unsigned long flags;
 
     if (av == NULL)
@@ -374,7 +374,7 @@ a653sched_do_schedule(
     struct sched_unit *new_task = NULL;
     static unsigned int sched_index = 0;
     static s_time_t next_switch_time;
-    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
+    struct a653sched_private *sched_priv = SCHED_PRIV(ops);
     const unsigned int cpu = sched_get_resource_cpu(smp_processor_id());
     unsigned long flags;
 
@@ -482,7 +482,7 @@ a653_switch_sched(struct scheduler *new_ops, unsigned int cpu,
                   void *pdata, void *vdata)
 {
     struct sched_resource *sr = get_sched_res(cpu);
-    const arinc653_unit_t *svc = vdata;
+    const struct a653sched_unit *svc = vdata;
 
     ASSERT(!pdata && svc && is_idle_unit(svc->unit));
 
-- 
2.17.1



  parent reply	other threads:[~2020-09-17  4:20 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 18:18 [PATCH 0/5] Multicore support for ARINC653 scheduler Jeff Kubascik
2020-09-16 18:18 ` [PATCH 1/5] sched/arinc653: Clean up comments Jeff Kubascik
2020-09-17 13:24   ` Andrew Cooper
2020-09-18 15:33     ` Jeff Kubascik
2020-09-16 18:18 ` Jeff Kubascik [this message]
2020-09-17 12:09   ` [PATCH 2/5] sched/arinc653: Rename scheduler private structs Andrew Cooper
2020-09-17 14:46     ` Dario Faggioli
2020-09-18 15:52       ` Jeff Kubascik
2020-09-16 18:18 ` [PATCH 3/5] sched/arinc653: Clean up function definitions Jeff Kubascik
2020-09-17  8:09   ` Jan Beulich
2020-09-17 14:40     ` Dario Faggioli
2020-09-18 17:43       ` Jeff Kubascik
2020-09-16 18:18 ` [PATCH 4/5] sched/arinc653: Reorganize function definition order Jeff Kubascik
2020-09-17  8:12   ` Jan Beulich
2020-09-17 14:16     ` Dario Faggioli
2020-09-18 18:21       ` Jeff Kubascik
2020-09-17 14:17     ` Andrew Cooper
2020-09-18 18:04       ` Jeff Kubascik
2020-09-18 18:05       ` Jeff Kubascik
2020-09-16 18:18 ` [PATCH 5/5] sched/arinc653: Implement CAST-32A multicore scheduling Jeff Kubascik
2020-09-17  9:04   ` Jürgen Groß
2020-09-17 15:10     ` Stewart Hildebrand
2020-09-17 15:18       ` Jürgen Groß
2020-09-17 15:20       ` Dario Faggioli
2020-09-17 15:59         ` Stewart Hildebrand
2020-09-17 17:30           ` Dario Faggioli
2020-09-18 20:03             ` Jeff Kubascik
2020-09-18 20:34               ` Dario Faggioli
2020-09-22 19:50               ` Andrew Cooper
2020-09-17 14:42   ` Andrew Cooper
2020-09-17 14:57     ` Stewart Hildebrand
2020-09-17 16:18       ` Andrew Cooper
2020-09-17 17:57         ` Stewart Hildebrand
2020-09-18 19:22           ` Jeff Kubascik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200916181854.75563-3-jeff.kubascik@dornerworks.com \
    --to=jeff.kubascik@dornerworks.com \
    --cc=dfaggioli@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=josh.whitehead@dornerworks.com \
    --cc=stewart.hildebrand@dornerworks.com \
    --cc=xen-devel@dornerworks.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.