From d7e29a11100389e249d42deb0e1ea2c98d355a9e Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Thu, 25 Aug 2022 06:34:10 -0400 Subject: [PATCH] [Docs] Remove rule about matching .c and .h files Signed-off-by: Mariusz Zaborski --- Documentation/devel/coding-style.rst | 4 ++-- libos/src/libos_checkpoint.c | 3 +-- pal/src/host/linux-sgx/enclave_ecalls.c | 3 +-- pal/src/host/linux-sgx/enclave_ocalls.c | 3 +-- pal/src/host/linux-sgx/enclave_pages.c | 3 +-- pal/src/host/linux-sgx/gdb_integration/sgx_gdb.c | 2 +- pal/src/host/linux-sgx/host_ecalls.c | 1 - 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Documentation/devel/coding-style.rst b/Documentation/devel/coding-style.rst index 71d4f6b544..e1e9b918b9 100644 --- a/Documentation/devel/coding-style.rst +++ b/Documentation/devel/coding-style.rst @@ -102,11 +102,11 @@ Code formatting Groups: - #. Matching :file:`.h` header for :file:`.c` files. #. Standard library headers. #. Non-standard headers not included in Gramine's repository (e.g. from external dependencies, like :file:`curl.h`). - #. Gramine's headers. + #. Gramine's headers (including matching :file:`.h` header for :file:`.c` + files). #. Assignments may be aligned when assigning some structurized data (e.g. struct members). Example:: diff --git a/libos/src/libos_checkpoint.c b/libos/src/libos_checkpoint.c index 99599e6388..d63e4de340 100644 --- a/libos/src/libos_checkpoint.c +++ b/libos/src/libos_checkpoint.c @@ -5,12 +5,11 @@ * This file contains implementation of checkpoint and restore. */ -#include "libos_checkpoint.h" - #include #include #include +#include "libos_checkpoint.h" #include "libos_internal.h" #include "libos_ipc.h" #include "libos_process.h" diff --git a/pal/src/host/linux-sgx/enclave_ecalls.c b/pal/src/host/linux-sgx/enclave_ecalls.c index 736af64090..0868fbf7d2 100644 --- a/pal/src/host/linux-sgx/enclave_ecalls.c +++ b/pal/src/host/linux-sgx/enclave_ecalls.c @@ -1,8 +1,7 @@ -#include "enclave_ecalls.h" - #include #include "api.h" +#include "enclave_ecalls.h" #include "pal_ecall_types.h" #include "pal_linux.h" #include "pal_rpc_queue.h" diff --git a/pal/src/host/linux-sgx/enclave_ocalls.c b/pal/src/host/linux-sgx/enclave_ocalls.c index 5e4253f1ab..1b1c5700f9 100644 --- a/pal/src/host/linux-sgx/enclave_ocalls.c +++ b/pal/src/host/linux-sgx/enclave_ocalls.c @@ -18,8 +18,6 @@ * values and report success instead of injecting -EINTR). */ -#include "enclave_ocalls.h" - #include #include #include @@ -29,6 +27,7 @@ #include "api.h" #include "asan.h" #include "cpu.h" +#include "enclave_ocalls.h" #include "pal_internal.h" #include "pal_ocall_types.h" #include "pal_rpc_queue.h" diff --git a/pal/src/host/linux-sgx/enclave_pages.c b/pal/src/host/linux-sgx/enclave_pages.c index 8ba5967f07..8b1af7f50d 100644 --- a/pal/src/host/linux-sgx/enclave_pages.c +++ b/pal/src/host/linux-sgx/enclave_pages.c @@ -1,7 +1,6 @@ -#include "enclave_pages.h" - #include "api.h" #include "asan.h" +#include "enclave_pages.h" #include "list.h" #include "pal_error.h" #include "pal_linux.h" diff --git a/pal/src/host/linux-sgx/gdb_integration/sgx_gdb.c b/pal/src/host/linux-sgx/gdb_integration/sgx_gdb.c index 27d474dc6a..ea1fec7184 100644 --- a/pal/src/host/linux-sgx/gdb_integration/sgx_gdb.c +++ b/pal/src/host/linux-sgx/gdb_integration/sgx_gdb.c @@ -1,5 +1,4 @@ #define _GNU_SOURCE -#include "sgx_gdb.h" #include #include @@ -17,6 +16,7 @@ #include #include "assert.h" +#include "sgx_gdb.h" #include "../sgx_arch.h" /* Used by GDB with PTRACE_GETREGSET. */ diff --git a/pal/src/host/linux-sgx/host_ecalls.c b/pal/src/host/linux-sgx/host_ecalls.c index 631881cc41..11e28ae2c7 100644 --- a/pal/src/host/linux-sgx/host_ecalls.c +++ b/pal/src/host/linux-sgx/host_ecalls.c @@ -2,7 +2,6 @@ /* Copyright (C) 2014 Stony Brook University */ #include "host_ecalls.h" - #include "host_internal.h" #include "pal_ecall_types.h" #include "pal_rpc_queue.h"