]> xenbits.xensource.com Git - xen.git/commitdiff
xen/time: fix MISRA C 2012 Rule 8.7 violation
authorXenia Ragiadakou <burzalodowa@gmail.com>
Wed, 6 Jul 2022 11:07:43 +0000 (13:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 6 Jul 2022 11:07:43 +0000 (13:07 +0200)
The variable __mon_lengths is referenced only in time.c.
Change its linkage from external to internal by adding the storage-class
specifier static to its definitions.

Also, this patch resolves indirectly a MISRA C 2012 Rule 8.4 violation warning.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/common/time.c

index 22379f4ae2e93ecf0d0334de17a06faea8a8c83d..92f7b72464723e6b4830c6db29d9d30ef46f47a7 100644 (file)
@@ -28,7 +28,7 @@
   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 
 /* How many days are in each month.  */
-const unsigned short int __mon_lengths[2][12] = {
+static const unsigned short int __mon_lengths[2][12] = {
     /* Normal years.  */
     {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
     /* Leap years.  */