From dcc483f534b45521e95ff64cdcc18dc21e7db392 Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Tue, 21 Apr 2015 16:15:59 -0400 Subject: [PATCH] Remove references to ENABLE_DEVICE_CHANNEL The ENABLE_DEVICE_CHANNEL macro is never defined. Furthermore, there are no records about what it is supposed to do even if it is defined. Change-Id: I6b9df005daebcd5af2ca4b3a9f98af8754d41488 Signed-off-by: Peter Mitsis Signed-off-by: Benjamin Walsh --- include/microkernel/chan.h | 11 ---- kernel/microkernel/channel/KS_Chan.c | 78 +++------------------------- 2 files changed, 6 insertions(+), 83 deletions(-) diff --git a/include/microkernel/chan.h b/include/microkernel/chan.h index bb5d6a75a11..750ac4c7337 100644 --- a/include/microkernel/chan.h +++ b/include/microkernel/chan.h @@ -100,17 +100,6 @@ extern PFN_CHANNEL_RWT pKS_Channel_GetWT; /* maps to KS__ChannelGetWT == _task_pipe_get */ extern PFN_CHANNEL_RWT pHS_Channel_GetWT; /* maps to HS_ChannelGetWT */ -#undef ENABLE_DEVICE_CHANNEL /* for the future */ - -#ifdef ENABLE_DEVICE_CHANNEL -extern PFN_CHANNEL_RW pKS_Device_Put; /* maps to NULL */ -extern PFN_CHANNEL_RW pKS_Device_PutW; /* maps to NULL */ -extern PFN_CHANNEL_RWT pKS_Device_PutWT; /* maps to NULL */ -extern PFN_CHANNEL_RW pKS_Device_Get; /* maps to NULL */ -extern PFN_CHANNEL_RW pKS_Device_GetW; /* maps to NULL */ -extern PFN_CHANNEL_RWT pKS_Device_GetWT; /* maps to NULL */ -#endif /* ENABLE_DEVICE_CHANNEL */ - /* mapping of KS__ChannelXXX() to _task_pipe_xxx() functions */ #define KS__ChannelPutWT _task_pipe_put diff --git a/kernel/microkernel/channel/KS_Chan.c b/kernel/microkernel/channel/KS_Chan.c index ff1a80cead0..f6e225f23d1 100644 --- a/kernel/microkernel/channel/KS_Chan.c +++ b/kernel/microkernel/channel/KS_Chan.c @@ -61,17 +61,7 @@ int task_pipe_put(kpipe_t id, NrOfBytesWritten, opt, TICKS_NONE); - } -#ifdef ENABLE_DEVICE_CHANNEL - else if (id & _DEVICE_CHANNEL) { /* a device channel */ - if (unlikely(pKS_Device_Put == NULL)) - return RC_FAIL; /* or an assert */ - - return (*pKS_Device_Put)( - id, buffer, NrOfBytesToWrite, NrOfBytesWritten, opt); - } -#endif - else { + } else { /* a host channel */ if (unlikely(pHS_Channel_Put == NULL)) return RC_FAIL; /* or an assert */ @@ -104,17 +94,7 @@ int task_pipe_put_wait(kpipe_t id, NrOfBytesWritten, opt, TICKS_UNLIMITED); - } -#ifdef ENABLE_DEVICE_CHANNEL - else if (id & _DEVICE_CHANNEL) { /* a device channel */ - if (unlikely(pKS_Device_PutW == NULL)) - return RC_FAIL; /* or an assert */ - - return (*pKS_Device_PutW)( - id, buffer, NrOfBytesToWrite, NrOfBytesWritten, opt); - } -#endif - else { + } else { /* a host channel */ if (unlikely(pHS_Channel_PutW == NULL)) return RC_FAIL; /* or an assert */ @@ -148,21 +128,7 @@ int task_pipe_put_wait_timeout(kpipe_t id, NrOfBytesWritten, opt, TimeOut); - } -#ifdef ENABLE_DEVICE_CHANNEL - else if (id & _DEVICE_CHANNEL) { /* a device channel */ - if (unlikely(pKS_Device_PutWT == NULL)) - return RC_FAIL; /* or an assert */ - - return (*pKS_Device_PutWT)(id, - buffer, - NrOfBytesToWrite, - NrOfBytesWritten, - opt, - TimeOut); - } -#endif - else { + } else { /* a host channel */ if (unlikely(pHS_Channel_PutWT == NULL)) return RC_FAIL; /* or an assert */ @@ -199,17 +165,7 @@ int task_pipe_get(kpipe_t id, NrOfBytesRead, opt, TICKS_NONE); - } -#ifdef ENABLE_DEVICE_CHANNEL - else if (id & _DEVICE_CHANNEL) { /* a device channel */ - if (unlikely(pKS_Device_GetWT == NULL)) - return RC_FAIL; /* or an assert */ - - return (*pKS_Device_Get)( - id, buffer, NrOfBytesToRead, NrOfBytesRead, opt); - } -#endif - else { + } else { /* a host channel */ if (unlikely(pHS_Channel_Get == NULL)) return RC_FAIL; /* or an assert */ @@ -241,16 +197,7 @@ int task_pipe_get_wait(kpipe_t id, NrOfBytesRead, opt, TICKS_UNLIMITED); - } -#ifdef ENABLE_DEVICE_CHANNEL - else if (id & _DEVICE_CHANNEL) { /* a device channel */ - if (unlikely(pKS_Device_GetW == NULL)) - return RC_FAIL; /* or an assert */ - return (*pKS_Device_GetW)( - id, buffer, NrOfBytesToRead, NrOfBytesRead, opt); - } -#endif - else { + } else { /* a host channel */ if (unlikely(pHS_Channel_GetW == NULL)) return RC_FAIL; /* or an assert */ @@ -282,20 +229,7 @@ int task_pipe_get_wait_timeout(kpipe_t id, NrOfBytesRead, opt, TimeOut); - } -#ifdef ENABLE_DEVICE_CHANNEL - else if (id & _DEVICE_CHANNEL) { /* a device channel */ - if (unlikely(pKS_Device_GetWT == NULL)) - return RC_FAIL; /* or an assert */ - return (*pKS_Device_GetWT)(id, - buffer, - NrOfBytesToRead, - NrOfBytesRead, - opt, - TimeOut); - } -#endif - else { + } else { /* a host channel */ if (unlikely(pHS_Channel_GetWT == NULL)) return RC_FAIL; /* or an assert */