Skip to content

Commit

Permalink
drivers: Rename MAX definition to avoid macro naming conflict.
Browse files Browse the repository at this point in the history
MAX can already be defined by the kernel headers and cause
compilation failure due to the redefinition, so use
MAX_ATTEMPTS to a more descriptive and non-conflicting name.

Resolves: asterisk#61
  • Loading branch information
InterLinked1 committed Sep 23, 2024
1 parent d932d9f commit 2973a4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions drivers/dahdi/opvxa1200/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,12 +868,12 @@ static int __wait_access(struct wctdm *wc, int card)
long origjiffies;
int count = 0;

#define MAX 6000 /* attempts */
#define MAX_ATTEMPTS 6000 /* attempts */


origjiffies = jiffies;
/* Wait for indirect access */
while (count++ < MAX)
while (count++ < MAX_ATTEMPTS)
{
data = __wctdm_getreg(wc, card, I_STATUS);

Expand All @@ -882,7 +882,7 @@ static int __wait_access(struct wctdm *wc, int card)

}

if(count > (MAX-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);
if(count > (MAX_ATTEMPTS-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);

return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/dahdi/wcaxx-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,16 +1066,16 @@ static int wait_access(struct wcaxx *wc, struct wcaxx_module *const mod)
unsigned char data = 0;
int count = 0;

#define MAX 10 /* attempts */
#define MAX_ATTEMPTS 10 /* attempts */

/* Wait for indirect access */
while (count++ < MAX) {
while (count++ < MAX_ATTEMPTS) {
data = wcaxx_getreg(wc, mod, I_STATUS);
if (!data)
return 0;
}

if (count > (MAX-1)) {
if (count > (MAX_ATTEMPTS-1)) {
dev_notice(&wc->xb.pdev->dev,
" ##### Loop error (%02x) #####\n", data);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/dahdi/wctdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,11 @@ static int __wait_access(struct wctdm *wc, int card)
unsigned char data = 0;
int count = 0;

#define MAX 6000 /* attempts */
#define MAX_ATTEMPTS 6000 /* attempts */


/* Wait for indirect access */
while (count++ < MAX)
while (count++ < MAX_ATTEMPTS)
{
data = __wctdm_getreg(wc, card, I_STATUS);

Expand All @@ -641,7 +641,7 @@ static int __wait_access(struct wctdm *wc, int card)

}

if(count > (MAX-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);
if(count > (MAX_ATTEMPTS-1)) printk(KERN_NOTICE " ##### Loop error (%02x) #####\n", data);

return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/dahdi/wctdm24xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,16 +1516,16 @@ static int wait_access(struct wctdm *wc, struct wctdm_module *const mod)
unsigned char data = 0;
int count = 0;

#define MAX 10 /* attempts */
#define MAX_ATTEMPTS 10 /* attempts */

/* Wait for indirect access */
while (count++ < MAX) {
while (count++ < MAX_ATTEMPTS) {
data = wctdm_getreg(wc, mod, I_STATUS);
if (!data)
return 0;
}

if (count > (MAX-1)) {
if (count > (MAX_ATTEMPTS-1)) {
dev_notice(&wc->vb.pdev->dev,
" ##### Loop error (%02x) #####\n", data);
}
Expand Down

0 comments on commit 2973a4b

Please sign in to comment.