]> git.pld-linux.org Git - packages/dahdi-linux.git/blob - strnicmp.patch
- fix building with linux 4.0
[packages/dahdi-linux.git] / strnicmp.patch
1 From 1559db9d1ae03780788788c07334ca54cdd1253a Mon Sep 17 00:00:00 2001
2 From: Shaun Ruffell <sruffell@digium.com>
3 Date: Mon, 2 Mar 2015 09:00:14 -0600
4 Subject: [PATCH] dahdi: strnicmp() -> strncasecmp()
5
6 With commit (af3cd13501 "lib/string.c: remove strnicmp()") [1] dahdi can no
7 longer call strnicmp directly. strncasecmp was added into lib/string.c in kernel
8 version 2.6.22 so we'll map calls to strncasecmp to strnicmp for any kernel
9 before that.
10
11 This is necessary to compile against kernels >= 4.0.
12
13 [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=af3cd13501
14
15 Signed-off-by: Shaun Ruffell <sruffell@digium.com>
16 Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
17 ---
18  drivers/dahdi/xpp/card_pri.c | 6 +++---
19  include/dahdi/kernel.h       | 2 ++
20  2 files changed, 5 insertions(+), 3 deletions(-)
21
22 diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c
23 index 29b457b..edc8bd2 100644
24 --- a/drivers/dahdi/xpp/card_pri.c
25 +++ b/drivers/dahdi/xpp/card_pri.c
26 @@ -2399,11 +2399,11 @@ static DEVICE_ATTR_WRITER(pri_protocol_store, dev, buf, count)
27                         buf, i);
28                 return -EINVAL;
29         }
30 -       if (strnicmp(buf, "E1", 2) == 0)
31 +       if (strncasecmp(buf, "E1", 2) == 0)
32                 new_protocol = PRI_PROTO_E1;
33 -       else if (strnicmp(buf, "T1", 2) == 0)
34 +       else if (strncasecmp(buf, "T1", 2) == 0)
35                 new_protocol = PRI_PROTO_T1;
36 -       else if (strnicmp(buf, "J1", 2) == 0)
37 +       else if (strncasecmp(buf, "J1", 2) == 0)
38                 new_protocol = PRI_PROTO_J1;
39         else {
40                 XPD_NOTICE(xpd,
41 diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
42 index 54c415e..90d48a3 100644
43 --- a/include/dahdi/kernel.h
44 +++ b/include/dahdi/kernel.h
45 @@ -1502,6 +1502,8 @@ void dahdi_pci_disable_link_state(struct pci_dev *pdev, int state);
46  #define list_first_entry(ptr, type, member) \
47         list_entry((ptr)->next, type, member)
48  
49 +#define strncasecmp strnicmp
50 +
51  #ifndef __packed
52  #define __packed  __attribute__((packed))
53  #endif 
This page took 0.045291 seconds and 3 git commands to generate.