[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 4/4] xen: Justify linker script defined symbols in include/xen/kernel.h





On 07/11/2022 12:56, Jan Beulich wrote:
On 07.11.2022 12:53, Luca Fancellu wrote:
On 7 Nov 2022, at 11:49, Jan Beulich <jbeulich@xxxxxxxx> wrote:
On 07.11.2022 11:47, Luca Fancellu wrote:
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -65,24 +65,28 @@
        1;                                      \
})

+/* SAF-0-safe R8.6 linker script defined symbols */
extern char _start[], _end[], start[];
#define is_kernel(p) ({                         \
     char *__p = (char *)(unsigned long)(p);     \
     (__p >= _start) && (__p < _end);            \
})

+/* SAF-0-safe R8.6 linker script defined symbols */
extern char _stext[], _etext[];
#define is_kernel_text(p) ({                    \
     char *__p = (char *)(unsigned long)(p);     \
     (__p >= _stext) && (__p < _etext);          \
})

+/* SAF-0-safe R8.6 linker script defined symbols */
extern const char _srodata[], _erodata[];
#define is_kernel_rodata(p) ({                  \
     const char *__p = (const char *)(unsigned long)(p);     \
     (__p >= _srodata) && (__p < _erodata);      \
})

+/* SAF-0-safe R8.6 linker script defined symbols */
extern char _sinittext[], _einittext[];
#define is_kernel_inittext(p) ({                \
     char *__p = (char *)(unsigned long)(p);     \

Why the "R8.6" everywhere here? Didn't we agree that the in-code
comments should be tool-agnostic?

The R8.6 is not tool specific, it is to give the quick hint that we are 
deviating
from MISRA Rule 8.6.

Well, yes, "tool" was wrong for me to write. Imo references to a specific
spec should equally be avoided in in-code comments, as other specs may
turn up.

+1. The comment duplication is not great and sometimes even a short explanation it may not fit in 80 characters (AFAICT the justification should be a one line comment).

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.