[rtems commit] posix: Remove superfluous includes
Sebastian Huber
sebh at rtems.org
Wed Sep 27 13:35:47 UTC 2017
Module: rtems
Branch: master
Commit: dbdb6a32f13a3c223aac5bdeb1e9684d5b2b886d
Changeset: http://git.rtems.org/rtems/commit/?id=dbdb6a32f13a3c223aac5bdeb1e9684d5b2b886d
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Sep 27 15:14:33 2017 +0200
posix: Remove superfluous includes
---
cpukit/posix/src/condattrdestroy.c | 11 ++++-------
cpukit/posix/src/condattrinit.c | 5 +----
cpukit/posix/src/mutexattrdestroy.c | 10 +++-------
cpukit/posix/src/mutexattrgetprioceiling.c | 9 ++-------
cpukit/posix/src/mutexattrgetprotocol.c | 9 ++-------
cpukit/posix/src/mutexattrgetpshared.c | 9 ++-------
cpukit/posix/src/mutexattrgettype.c | 15 ++-------------
cpukit/posix/src/mutexattrinit.c | 7 ++-----
8 files changed, 18 insertions(+), 57 deletions(-)
diff --git a/cpukit/posix/src/condattrdestroy.c b/cpukit/posix/src/condattrdestroy.c
index d35a3ff..9629507 100644
--- a/cpukit/posix/src/condattrdestroy.c
+++ b/cpukit/posix/src/condattrdestroy.c
@@ -18,13 +18,10 @@
#include "config.h"
#endif
-#include <pthread.h>
#include <errno.h>
-
-#include <rtems/system.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/condimpl.h>
-#include <rtems/posix/muteximpl.h>
+#include <pthread.h>
+#include <stddef.h>
+#include <stdbool.h>
/*
* 11.4.1 Condition Variable Initialization Attributes,
@@ -35,7 +32,7 @@ int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
- if ( !attr || attr->is_initialized == false )
+ if ( attr == NULL || !attr->is_initialized )
return EINVAL;
attr->is_initialized = false;
diff --git a/cpukit/posix/src/condattrinit.c b/cpukit/posix/src/condattrinit.c
index f4d8e39..15b03c9 100644
--- a/cpukit/posix/src/condattrinit.c
+++ b/cpukit/posix/src/condattrinit.c
@@ -21,10 +21,7 @@
#include <pthread.h>
#include <errno.h>
-#include <rtems/system.h>
-#include <rtems/score/watchdog.h>
#include <rtems/posix/condimpl.h>
-#include <rtems/posix/muteximpl.h>
/*
* 11.4.1 Condition Variable Initialization Attributes,
@@ -35,7 +32,7 @@ int pthread_condattr_init(
pthread_condattr_t *attr
)
{
- if ( !attr )
+ if ( attr == NULL )
return EINVAL;
*attr = _POSIX_Condition_variables_Default_attributes;
diff --git a/cpukit/posix/src/mutexattrdestroy.c b/cpukit/posix/src/mutexattrdestroy.c
index 1817a26..2b63fe2 100644
--- a/cpukit/posix/src/mutexattrdestroy.c
+++ b/cpukit/posix/src/mutexattrdestroy.c
@@ -20,12 +20,8 @@
#include <errno.h>
#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremuteximpl.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/priorityimpl.h>
+#include <stddef.h>
+#include <stdbool.h>
/**
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
@@ -34,7 +30,7 @@ int pthread_mutexattr_destroy(
pthread_mutexattr_t *attr
)
{
- if ( !attr || !attr->is_initialized )
+ if ( attr == NULL || !attr->is_initialized )
return EINVAL;
attr->is_initialized = false;
diff --git a/cpukit/posix/src/mutexattrgetprioceiling.c b/cpukit/posix/src/mutexattrgetprioceiling.c
index d8bb007..928347e 100644
--- a/cpukit/posix/src/mutexattrgetprioceiling.c
+++ b/cpukit/posix/src/mutexattrgetprioceiling.c
@@ -20,12 +20,7 @@
#include <errno.h>
#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremuteximpl.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/priorityimpl.h>
+#include <stddef.h>
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
@@ -36,7 +31,7 @@ int pthread_mutexattr_getprioceiling(
int *prioceiling
)
{
- if ( !attr || !attr->is_initialized || !prioceiling )
+ if ( attr == NULL || !attr->is_initialized || prioceiling == NULL)
return EINVAL;
*prioceiling = attr->prio_ceiling;
diff --git a/cpukit/posix/src/mutexattrgetprotocol.c b/cpukit/posix/src/mutexattrgetprotocol.c
index efb4a7f..0b77e39 100644
--- a/cpukit/posix/src/mutexattrgetprotocol.c
+++ b/cpukit/posix/src/mutexattrgetprotocol.c
@@ -20,12 +20,7 @@
#include <errno.h>
#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremuteximpl.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/priorityimpl.h>
+#include <stddef.h>
/*
* 13.6.1 Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128
@@ -36,7 +31,7 @@ int pthread_mutexattr_getprotocol(
int *protocol
)
{
- if ( !attr || !attr->is_initialized || !protocol )
+ if ( attr == NULL || !attr->is_initialized || protocol == NULL )
return EINVAL;
*protocol = attr->protocol;
diff --git a/cpukit/posix/src/mutexattrgetpshared.c b/cpukit/posix/src/mutexattrgetpshared.c
index 5ef8c59..5f8efb7 100644
--- a/cpukit/posix/src/mutexattrgetpshared.c
+++ b/cpukit/posix/src/mutexattrgetpshared.c
@@ -20,12 +20,7 @@
#include <errno.h>
#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremuteximpl.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/priorityimpl.h>
+#include <stddef.h>
/*
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
@@ -36,7 +31,7 @@ int pthread_mutexattr_getpshared(
int *pshared
)
{
- if ( !attr || !attr->is_initialized || !pshared )
+ if ( attr == NULL || !attr->is_initialized || pshared == NULL )
return EINVAL;
*pshared = attr->process_shared;
diff --git a/cpukit/posix/src/mutexattrgettype.c b/cpukit/posix/src/mutexattrgettype.c
index 3c12dcb..61b6d58 100644
--- a/cpukit/posix/src/mutexattrgettype.c
+++ b/cpukit/posix/src/mutexattrgettype.c
@@ -20,12 +20,7 @@
#include <errno.h>
#include <pthread.h>
-
-#include <rtems/system.h>
-#include <rtems/score/coremuteximpl.h>
-#include <rtems/score/watchdog.h>
-#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/priorityimpl.h>
+#include <stddef.h>
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
int pthread_mutexattr_gettype(
@@ -33,13 +28,7 @@ int pthread_mutexattr_gettype(
int *type
)
{
- if ( !attr )
- return EINVAL;
-
- if ( !attr->is_initialized )
- return EINVAL;
-
- if ( !type )
+ if ( attr == NULL || !attr->is_initialized || type == NULL )
return EINVAL;
*type = attr->type;
diff --git a/cpukit/posix/src/mutexattrinit.c b/cpukit/posix/src/mutexattrinit.c
index 7c249ba..fea765d 100644
--- a/cpukit/posix/src/mutexattrinit.c
+++ b/cpukit/posix/src/mutexattrinit.c
@@ -20,12 +20,9 @@
#include <errno.h>
#include <pthread.h>
+#include <stddef.h>
-#include <rtems/system.h>
-#include <rtems/score/coremuteximpl.h>
-#include <rtems/score/watchdog.h>
#include <rtems/posix/muteximpl.h>
-#include <rtems/posix/priorityimpl.h>
/**
* 11.3.1 Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81
@@ -34,7 +31,7 @@ int pthread_mutexattr_init(
pthread_mutexattr_t *attr
)
{
- if ( !attr )
+ if ( attr == NULL )
return EINVAL;
*attr = _POSIX_Mutex_Default_attributes;
More information about the vc
mailing list