From: Florian Bezdeka <florian.bezdeka@siemens.com>
To: jan.kiszka@siemens.com, xenomai@lists.linux.dev
Cc: Florian Bezdeka <florian.bezdeka@siemens.com>
Subject: [PATCH 08/13] lib/boilerplate: Cleanup includes
Date: Tue, 05 Dec 2023 13:41:45 +0100 [thread overview]
Message-ID: <20231201-flo-array-size-v1-8-3e0abd7c68fa@siemens.com> (raw)
In-Reply-To: <20231201-flo-array-size-v1-0-3e0abd7c68fa@siemens.com>
- Add an empty line between license information and first include,
that is what most files already did
- Cleanup unused / unnecessary includes where possible
Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
lib/boilerplate/ancillaries.c | 4 +---
lib/boilerplate/avl.c | 1 +
lib/boilerplate/debug.c | 7 ++-----
lib/boilerplate/hash.c | 2 +-
lib/boilerplate/heapmem.c | 5 ++---
lib/boilerplate/iniparser/dictionary.c | 1 -
lib/boilerplate/init/bootstrap.c | 1 +
lib/boilerplate/setup.c | 5 ++---
lib/boilerplate/time.c | 1 +
lib/boilerplate/version.c | 1 +
10 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/lib/boilerplate/ancillaries.c b/lib/boilerplate/ancillaries.c
index 457ef0b7c..9ca55a6bc 100644
--- a/lib/boilerplate/ancillaries.c
+++ b/lib/boilerplate/ancillaries.c
@@ -15,6 +15,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
#include <sys/types.h>
#include <sys/syscall.h>
#include <stdio.h>
@@ -32,13 +33,10 @@
#include "boilerplate/atomic.h"
#include "boilerplate/lock.h"
#include "boilerplate/time.h"
-#include "boilerplate/scope.h"
#include "boilerplate/setup.h"
-#include "boilerplate/debug.h"
#include "boilerplate/ancillaries.h"
#include "boilerplate/signal.h"
#include "boilerplate/namegen.h"
-#include "xenomai/init.h"
pthread_mutex_t __printlock;
diff --git a/lib/boilerplate/avl.c b/lib/boilerplate/avl.c
index 3bf9bf134..c5cb253c0 100644
--- a/lib/boilerplate/avl.c
+++ b/lib/boilerplate/avl.c
@@ -20,6 +20,7 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+
#include <errno.h>
#include <memory.h>
diff --git a/lib/boilerplate/debug.c b/lib/boilerplate/debug.c
index 42ea8e8ef..f6df6c612 100644
--- a/lib/boilerplate/debug.c
+++ b/lib/boilerplate/debug.c
@@ -15,21 +15,18 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
-#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <pthread.h>
#include <malloc.h>
-#include <errno.h>
-#include <signal.h>
+
#include "boilerplate/ancillaries.h"
-#include "boilerplate/wrappers.h"
#include "boilerplate/lock.h"
#include "boilerplate/signal.h"
-#include "boilerplate/debug.h"
static pthread_key_t btkey;
diff --git a/lib/boilerplate/hash.c b/lib/boilerplate/hash.c
index 9ce1b7cb7..055332c7e 100644
--- a/lib/boilerplate/hash.c
+++ b/lib/boilerplate/hash.c
@@ -18,9 +18,9 @@
#include <string.h>
#include <errno.h>
+
#include "boilerplate/lock.h"
#include "boilerplate/hash.h"
-#include "boilerplate/debug.h"
/*
* Crunching routine borrowed from:
diff --git a/lib/boilerplate/heapmem.c b/lib/boilerplate/heapmem.c
index e6369c715..8050eb7ab 100644
--- a/lib/boilerplate/heapmem.c
+++ b/lib/boilerplate/heapmem.c
@@ -23,15 +23,14 @@
* multi-page memory ranges, and pages holding bucketed memory have a
* fast allocation bitmap to manage their blocks internally.
*/
+
#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+
#include <boilerplate/heapmem.h>
enum heapmem_pgtype {
diff --git a/lib/boilerplate/iniparser/dictionary.c b/lib/boilerplate/iniparser/dictionary.c
index cb7ccd49e..7985ab3fc 100644
--- a/lib/boilerplate/iniparser/dictionary.c
+++ b/lib/boilerplate/iniparser/dictionary.c
@@ -18,7 +18,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
/** Maximum value size for integers and doubles. */
#define MAXVALSZ 1024
diff --git a/lib/boilerplate/init/bootstrap.c b/lib/boilerplate/init/bootstrap.c
index 64a11c2d2..d77f4eb5c 100644
--- a/lib/boilerplate/init/bootstrap.c
+++ b/lib/boilerplate/init/bootstrap.c
@@ -44,6 +44,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/boilerplate/setup.c b/lib/boilerplate/setup.c
index a9138e96b..26c8c4cf5 100644
--- a/lib/boilerplate/setup.c
+++ b/lib/boilerplate/setup.c
@@ -15,8 +15,8 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
#include <sys/types.h>
-#include <sys/mman.h>
#include <sched.h>
#include <getopt.h>
#include <string.h>
@@ -24,14 +24,13 @@
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
-#include <memory.h>
#include <malloc.h>
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
+
#include <xeno_config.h>
#include <boilerplate/lock.h>
-#include <boilerplate/debug.h>
#include <boilerplate/ancillaries.h>
#include <xenomai/init.h>
diff --git a/lib/boilerplate/time.c b/lib/boilerplate/time.c
index d11259323..b9f5174c4 100644
--- a/lib/boilerplate/time.c
+++ b/lib/boilerplate/time.c
@@ -15,6 +15,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
#include "boilerplate/time.h"
void timespec_sub(struct timespec *__restrict r,
diff --git a/lib/boilerplate/version.c b/lib/boilerplate/version.c
index d28c4967e..03af13cad 100644
--- a/lib/boilerplate/version.c
+++ b/lib/boilerplate/version.c
@@ -15,6 +15,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+
#include <xeno_config.h>
#include "git-stamp.h"
--
2.39.2
next prev parent reply other threads:[~2023-12-05 12:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 12:41 [PATCH 00/13] Migration to ARRAY_SIZE() and further include cleanups Florian Bezdeka
2023-12-05 12:41 ` [PATCH 01/13] testsuite: Migrate to ARRAY_SIZE() Florian Bezdeka
2023-12-05 12:41 ` [PATCH 02/13] demo: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 03/13] lib: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 04/13] kernel/drivers: Mirate " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 05/13] demo: Cleanup includes Florian Bezdeka
2023-12-05 12:41 ` [PATCH 06/13] lib/alchemy: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 07/13] lib/analogy: " Florian Bezdeka
2023-12-05 12:41 ` Florian Bezdeka [this message]
2023-12-05 12:41 ` [PATCH 09/13] lib/copperplate: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 10/13] lib/psos: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 11/13] lib/smokey: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 12/13] lib/trank: " Florian Bezdeka
2023-12-05 12:41 ` [PATCH 13/13] lib/vxworks: " Florian Bezdeka
2023-12-07 2:37 ` [PATCH 00/13] Migration to ARRAY_SIZE() and further include cleanups Jan Kiszka
2023-12-07 9:13 ` Jan Kiszka
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=20231201-flo-array-size-v1-8-3e0abd7c68fa@siemens.com \
--to=florian.bezdeka@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@lists.linux.dev \
/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.