Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dahdi_echocan_mg2: rename ABS define to PARA_ABS #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions drivers/dahdi/dahdi-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@

#include "hpec/hpec_user.h"

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#if defined(EMPULSE) && defined(EMFLASH)
#error "You cannot define both EMPULSE and EMFLASH"
#endif
Expand Down
6 changes: 3 additions & 3 deletions drivers/dahdi/dahdi_echocan_mg2.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
static int debug;
static int aggressive;

#define ABS(a) abs(a!=-32768?a:-32767)
#define PARA_ABS(a) abs(a!=-32768?a:-32767)

#define RESTORE_COEFFS {\
int x;\
Expand Down Expand Up @@ -464,9 +464,9 @@ static inline short sample_update(struct ec_pvt *pvt, short iref, short isig)
RESTORE_COEFFS;
}

sign_error = ABS(rs) - ABS(isig);
sign_error = PARA_ABS(rs) - PARA_ABS(isig);

if (ABS(sign_error) > MAX_SIGN_ERROR)
if (PARA_ABS(sign_error) > MAX_SIGN_ERROR)
{
rs = 0;
RESTORE_COEFFS;
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/voicebus/vpmoct.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
#include <linux/timer.h>
#include "dahdi/kernel.h"

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#define VPMOCT_FIRM_HEADER_LEN 32
#define VPMOCT_BOOT_RAM_LEN 128
#define VPMOCT_FLASH_BUF_SECTIONS 4
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wcaxx-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@
#include <linux/firmware.h>
#include <linux/crc32.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
/* Define this if you would like to load the modules in parallel. While this
* can speed up loads when multiple cards handled by this driver are installed,
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wct4xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
#include <linux/crc32.h>
#include <linux/slab.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#include <dahdi/kernel.h>

#include "wct4xxp.h"
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wct4xxp/vpm450m.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@

#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#include "vpm450m.h"
#include <oct612x.h>

Expand Down
8 changes: 0 additions & 8 deletions drivers/dahdi/wctc4xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@
#include <linux/timer.h>
#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif


#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#endif /* 4.11.0 */
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wctdm24xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00 db
#include <linux/crc32.h>
#include <linux/slab.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
/* Define this if you would like to load the modules in parallel. While this
* can speed up loads when multiple cards handled by this driver are installed,
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wcte13xp-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@
#include <linux/crc32.h>
#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#include "wct4xxp/wct4xxp.h" /* For certain definitions */
#include "wcxb.h"
#include "wcxb_spi.h"
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wcte43x-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@
#include <linux/firmware.h>
#include <oct612x.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#include <dahdi/kernel.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
Expand Down
7 changes: 0 additions & 7 deletions drivers/dahdi/wcxb.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@

#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#include "wcxb.h"
#include "wcxb_spi.h"
#include "wcxb_flash.h"
Expand Down
3 changes: 3 additions & 0 deletions drivers/dahdi/wcxb_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif
Expand Down
16 changes: 16 additions & 0 deletions include/dahdi/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
#define netif_napi_add netif_napi_add_weight
#endif

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
#include <linux/pci.h>
#include <linux/dma-mapping.h>
Expand Down Expand Up @@ -1552,6 +1562,12 @@ static inline void *PDE_DATA(const struct inode *inode)
#endif
#endif

#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#define netif_napi_add netif_napi_add_weight
#define PDE_DATA(i) pde_data(i)
#endif

#ifndef TIMER_DATA_TYPE
#define TIMER_DATA_TYPE struct timer_list *
#endif
Expand Down