osmith has submitted this change. ( https://gerrit.osmocom.org/c/dahdi-linux/+/39591?usp=email )
Change subject: drivers/dahdi: fix MAX redefine ......................................................................
drivers/dahdi: fix MAX redefine
Fix for this error with linux v6.11-rc2:
CC [M] oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o wctdm24xxp/base.c: In function 'wait_access': wctdm24xxp/base.c:1504: error: "MAX" redefined [-Werror] 1504 | #define MAX 10 /* attempts */ | In file included from /linux/include/linux/kernel.h:28, from wctdm24xxp/base.c:41: /linux/include/linux/minmax.h:330: note: this is the location of the previous definition 330 | #define MAX(a,b) __cmp(max,a,b)
Related: linux 1a251f52 ("minmax: make generic MIN() and MAX() macros available everywhere") Change-Id: If048523ac2c69b1251fdee758a2cd3e14f8e617c --- M drivers/dahdi/wcaxx-base.c M drivers/dahdi/wctdm24xxp/base.c 2 files changed, 6 insertions(+), 6 deletions(-)
Approvals: osmith: Looks good to me, approved; Verified
diff --git a/drivers/dahdi/wcaxx-base.c b/drivers/dahdi/wcaxx-base.c index d3d0777..a54188d 100644 --- a/drivers/dahdi/wcaxx-base.c +++ b/drivers/dahdi/wcaxx-base.c @@ -1050,16 +1050,16 @@ unsigned char data = 0; int count = 0;
- #define MAX 10 /* attempts */ + #define MAX_ATTEMPTS 10
/* 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); } diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 9725d3c..5de4ae8 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -1501,16 +1501,16 @@ unsigned char data = 0; int count = 0;
- #define MAX 10 /* attempts */ + #define MAX_ATTEMPTS 10
/* 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); }