diff mbox series

[XEN,v2] common/sched: address a violation of MISRA C Rule 8.8

Message ID 994b423128711b2a912401ff4cb13107ad5c6a9d.1718999221.git.victorm.lira@amd.com (mailing list archive)
State New
Headers show
Series [XEN,v2] common/sched: address a violation of MISRA C Rule 8.8 | expand

Commit Message

victorm.lira@amd.com June 21, 2024, 7:59 p.m. UTC
From: Victor Lira <victorm.lira@amd.com>

Rule 8.8: "The static storage class specifier shall be used in all
declarations of objects and functions that have internal linkage"

This patch fixes this by adding the static specifier.
No functional changes.

Reported-by: Stewart Hildebrand stewart.hildebrand@amd.com
Signed-off-by: Victor Lira <victorm.lira@amd.com>
Acked-by: George Dunlap <george.dunlap@cloud.com>
---
Changes from v1:
- adjust indentation and line width.
---
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Dario Faggioli <dfaggioli@suse.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
---
 xen/common/sched/credit2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Federico Serafini June 21, 2024, 9:04 p.m. UTC | #1
Hi,

On 21/06/24 21:59, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
> 
> Rule 8.8: "The static storage class specifier shall be used in all
> declarations of objects and functions that have internal linkage"

What you are addressing with this patch seems to be a violation of
Rule 8.7: "Functions and objects should not be defined with external
linkage if they are referenced in only one translation unit".

> 
> This patch fixes this by adding the static specifier.
> No functional changes.
> 
> Reported-by: Stewart Hildebrand stewart.hildebrand@amd.com
> Signed-off-by: Victor Lira <victorm.lira@amd.com>
> Acked-by: George Dunlap <george.dunlap@cloud.com>
> ---
> Changes from v1:
> - adjust indentation and line width.
> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Dario Faggioli <dfaggioli@suse.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>   xen/common/sched/credit2.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> index 685929c290..b4e03e2a63 100644
> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -1476,8 +1476,8 @@ static inline void runq_remove(struct csched2_unit *svc)
>       list_del_init(&svc->runq_elem);
>   }
>   
> -void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_unit *svc,
> -                  s_time_t now);
> +static void burn_credits(struct csched2_runqueue_data *rqd,
> +                         struct csched2_unit *svc, s_time_t now);
>   
>   static inline void
>   tickle_cpu(unsigned int cpu, struct csched2_runqueue_data *rqd)
> @@ -1855,8 +1855,8 @@ static void reset_credit(int cpu, s_time_t now, struct csched2_unit *snext)
>       /* No need to resort runqueue, as everyone's order should be the same. */
>   }
>   
> -void burn_credits(struct csched2_runqueue_data *rqd,
> -                  struct csched2_unit *svc, s_time_t now)
> +static void burn_credits(struct csched2_runqueue_data *rqd,
> +                         struct csched2_unit *svc, s_time_t now)
>   {
>       s_time_t delta;
>
diff mbox series

Patch

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 685929c290..b4e03e2a63 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -1476,8 +1476,8 @@  static inline void runq_remove(struct csched2_unit *svc)
     list_del_init(&svc->runq_elem);
 }
 
-void burn_credits(struct csched2_runqueue_data *rqd, struct csched2_unit *svc,
-                  s_time_t now);
+static void burn_credits(struct csched2_runqueue_data *rqd,
+                         struct csched2_unit *svc, s_time_t now);
 
 static inline void
 tickle_cpu(unsigned int cpu, struct csched2_runqueue_data *rqd)
@@ -1855,8 +1855,8 @@  static void reset_credit(int cpu, s_time_t now, struct csched2_unit *snext)
     /* No need to resort runqueue, as everyone's order should be the same. */
 }
 
-void burn_credits(struct csched2_runqueue_data *rqd,
-                  struct csched2_unit *svc, s_time_t now)
+static void burn_credits(struct csched2_runqueue_data *rqd,
+                         struct csched2_unit *svc, s_time_t now)
 {
     s_time_t delta;