Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: epl: remove __KERNEL__ checks

We are in the kernel, so these checks are pointless.

Cc: Daniel Krueger <daniel.krueger@systec-electronic.com>
Cc: Ronald Sieber <Ronald.Sieber@systec-electronic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+1 -80
-9
drivers/staging/epl/Benchmark.h
··· 73 73 74 74 #include "global.h" 75 75 76 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 77 - 78 - // #include <linux/config.h> 79 76 #include <linux/kernel.h> 80 77 81 78 #ifdef CONFIG_COLDFIRE ··· 85 88 #else 86 89 #undef BENCHMARK_MODULES 87 90 #define BENCHMARK_MODULES 0x00000000 88 - #endif 89 - 90 - #else 91 - // disable Benchmarking 92 - #undef BENCHMARK_MODULES 93 - #define BENCHMARK_MODULES 0x00000000 94 91 #endif 95 92 96 93 /***************************************************************************/
+1 -20
drivers/staging/epl/EplApiProcessImage.c
··· 69 69 ****************************************************************************/ 70 70 71 71 #include "Epl.h" 72 - //#include "kernel/EplPdokCal.h" 73 72 74 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 75 - #include <asm/uaccess.h> 76 - #endif 73 + #include <linux/uaccess.h> 77 74 78 75 /***************************************************************************/ 79 76 /* */ ··· 282 285 tEplKernel Ret = kEplSuccessful; 283 286 284 287 #if EPL_API_PROCESS_IMAGE_SIZE_IN > 0 285 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 286 288 copy_to_user(pPI_p->m_pImage, 287 289 EplApiProcessImageInstance_g.m_abProcessImageInput, 288 290 min(pPI_p->m_uiSize, 289 291 sizeof(EplApiProcessImageInstance_g. 290 292 m_abProcessImageInput))); 291 - #else 292 - EPL_MEMCPY(pPI_p->m_pImage, 293 - EplApiProcessImageInstance_g.m_abProcessImageInput, 294 - min(pPI_p->m_uiSize, 295 - sizeof(EplApiProcessImageInstance_g. 296 - m_abProcessImageInput))); 297 - #endif 298 293 #endif 299 294 300 295 return Ret; ··· 309 320 tEplKernel Ret = kEplSuccessful; 310 321 311 322 #if EPL_API_PROCESS_IMAGE_SIZE_OUT > 0 312 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 313 323 copy_from_user(EplApiProcessImageInstance_g.m_abProcessImageOutput, 314 324 pPI_p->m_pImage, 315 325 min(pPI_p->m_uiSize, 316 326 sizeof(EplApiProcessImageInstance_g. 317 327 m_abProcessImageOutput))); 318 - #else 319 - EPL_MEMCPY(EplApiProcessImageInstance_g.m_abProcessImageOutput, 320 - pPI_p->m_pImage, 321 - min(pPI_p->m_uiSize, 322 - sizeof(EplApiProcessImageInstance_g. 323 - m_abProcessImageOutput))); 324 - #endif 325 328 #endif 326 329 327 330 return Ret;
-26
drivers/staging/epl/EplSdoUdpu.c
··· 72 72 73 73 #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_SDO_UDP)) != 0) 74 74 75 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 76 75 #include "SocketLinuxKernel.h" 77 76 #include <linux/completion.h> 78 77 #include <linux/sched.h> 79 - #endif 80 78 81 79 /***************************************************************************/ 82 80 /* */ ··· 108 110 tEplSequLayerReceiveCb m_fpSdoAsySeqCb; 109 111 SOCKET m_UdpSocket; 110 112 111 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 112 113 struct completion m_CompletionUdpThread; 113 114 int m_ThreadHandle; 114 115 int m_iTerminateThread; 115 - #endif 116 - 117 116 } tEplSdoUdpInstance; 118 117 119 118 //--------------------------------------------------------------------------- ··· 123 128 // local function prototypes 124 129 //--------------------------------------------------------------------------- 125 130 126 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 127 131 static int EplSdoUdpThread(void *pArg_p); 128 - #endif 129 132 130 133 /***************************************************************************/ 131 134 /* */ ··· 207 214 goto Exit; 208 215 } 209 216 210 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 211 217 init_completion(&SdoUdpInstance_g.m_CompletionUdpThread); 212 218 SdoUdpInstance_g.m_iTerminateThread = 0; 213 - #endif 214 - 215 219 SdoUdpInstance_g.m_ThreadHandle = 0; 216 220 SdoUdpInstance_g.m_UdpSocket = INVALID_SOCKET; 217 221 ··· 244 254 245 255 if (SdoUdpInstance_g.m_ThreadHandle != 0) { // listen thread was started 246 256 // close thread 247 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 248 257 SdoUdpInstance_g.m_iTerminateThread = 1; 249 258 /* kill_proc(SdoUdpInstance_g.m_ThreadHandle, SIGTERM, 1 ); */ 250 259 send_sig(SIGTERM, SdoUdpInstance_g.m_ThreadHandle, 1); 251 260 wait_for_completion(&SdoUdpInstance_g.m_CompletionUdpThread); 252 - #endif 253 - 254 261 SdoUdpInstance_g.m_ThreadHandle = 0; 255 262 } 256 263 ··· 294 307 if (SdoUdpInstance_g.m_ThreadHandle != 0) { // listen thread was started 295 308 296 309 // close old thread 297 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 298 310 SdoUdpInstance_g.m_iTerminateThread = 1; 299 311 /* kill_proc(SdoUdpInstance_g.m_ThreadHandle, SIGTERM, 1 ); */ 300 312 send_sig(SIGTERM, SdoUdpInstance_g.m_ThreadHandle, 1); 301 313 wait_for_completion(&SdoUdpInstance_g.m_CompletionUdpThread); 302 314 SdoUdpInstance_g.m_iTerminateThread = 0; 303 - #endif 304 - 305 315 SdoUdpInstance_g.m_ThreadHandle = 0; 306 316 } 307 317 ··· 333 349 goto Exit; 334 350 } 335 351 // create Listen-Thread 336 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 337 - 338 352 SdoUdpInstance_g.m_ThreadHandle = 339 353 kernel_thread(EplSdoUdpThread, &SdoUdpInstance_g, CLONE_KERNEL); 340 354 if (SdoUdpInstance_g.m_ThreadHandle == 0) { 341 355 Ret = kEplSdoUdpThreadError; 342 356 goto Exit; 343 357 } 344 - #endif 345 358 346 359 Exit: 347 360 return Ret; ··· 554 573 unsigned int uiSize; 555 574 tEplSdoConHdl SdoConHdl; 556 575 557 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 558 576 pInstance = (tEplSdoUdpInstance *) pArg_p; 559 577 daemonize("EplSdoUdpThread"); 560 578 allow_signal(SIGTERM); 561 579 562 580 for (; pInstance->m_iTerminateThread == 0;) 563 - #endif 564 581 565 582 { 566 583 // wait for data ··· 569 590 0, // flags 570 591 (struct sockaddr *)&RemoteAddr, 571 592 (int *)&uiSize); 572 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 573 593 if (iError == -ERESTARTSYS) { 574 594 break; 575 595 } 576 - #endif 577 596 if (iError > 0) { 578 597 // get handle for higher layer 579 598 iCount = 0; ··· 640 663 } // end of if(iError!=SOCKET_ERROR) 641 664 } // end of for(;;) 642 665 643 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 644 666 complete_and_exit(&SdoUdpInstance_g.m_CompletionUdpThread, 0); 645 - #endif 646 - 647 667 return 0; 648 668 } 649 669
-11
drivers/staging/epl/EplTarget.h
··· 83 83 // applications needs to use one common library function (e.g. memcpy()). So 84 84 // you can set (or change) it here. 85 85 86 - #ifndef __KERNEL__ 87 - #include <stdlib.h> 88 - #include <stdio.h> 89 - #else 90 - // #include <linux/config.h> 91 86 #include <linux/module.h> 92 87 #include <linux/kernel.h> 93 88 #include <linux/init.h> 94 89 #include <linux/errno.h> 95 90 #include <linux/major.h> 96 91 #include <linux/version.h> 97 - #endif 98 92 99 93 //29.11.2004 f.j. sonst ist memcpy und memset unbekannt 100 94 // #include <string.h> ··· 96 102 #define EPL_MEMCPY(dst,src,siz) memcpy((void*)(dst),(const void*)(src),(size_t)(siz)); 97 103 #define EPL_MEMSET(dst,val,siz) memset((void*)(dst),(int)(val),(size_t)(siz)); 98 104 99 - #ifndef __KERNEL__ 100 - #define EPL_MALLOC(siz) malloc((size_t)(siz)) 101 - #define EPL_FREE(ptr) free((void *)ptr) 102 - #else 103 105 #define EPL_MALLOC(siz) kmalloc((size_t)(siz), GFP_KERNEL) 104 106 #define EPL_FREE(ptr) kfree((void *)ptr) 105 - #endif 106 107 107 108 #ifndef PRINTF0 108 109 #define PRINTF TRACE
-7
drivers/staging/epl/SharedBuff.c
··· 85 85 #include "SharedBuff.h" 86 86 #include "ShbIpc.h" 87 87 88 - // d.k. Linux kernel modules needs other header files for memcpy() 89 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) 90 88 #include <linux/string.h> 91 89 #include <linux/kernel.h> 92 - #else 93 - #include <stdio.h> 94 - #include <stdlib.h> 95 - #include <string.h> 96 - #endif 97 90 98 91 /***************************************************************************/ 99 92 /* */
-7
drivers/staging/epl/global.h
··· 288 288 //--------------------------------------------------------------------------- 289 289 290 290 #ifndef ASSERT 291 - #if !defined (__linux__) && !defined (__KERNEL__) 292 - #include <assert.h> 293 - #ifndef ASSERT 294 - #define ASSERT(p) assert(p) 295 - #endif 296 - #else 297 291 #define ASSERT(p) 298 - #endif 299 292 #endif 300 293 301 294 //---------------------------------------------------------------------------