diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-25 23:02:14 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-29 04:45:06 -0400 |
commit | b393243fe7b711eb18eafaaf469bdb39317adf5b (patch) | |
tree | bc0222c7ac1ff129d75a51d06acbee68d486fde0 /drivers | |
parent | 2a397e82c7db18019e408f953dd58dc1963a328c (diff) |
[ISDN] capidrv: address two longstanding warnings
* change #warning to a code comment
* add comment and special ifdef'd 64-bit code for a situation where
we must store a pointer into a CAPI field 'Data', which is fixed by
the interface at 32 bits.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/isdn/capi/capidrv.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 476012b6dfac..48c1775ef5b3 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c | |||
@@ -1843,6 +1843,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1843 | int msglen; | 1843 | int msglen; |
1844 | u16 errcode; | 1844 | u16 errcode; |
1845 | u16 datahandle; | 1845 | u16 datahandle; |
1846 | u32 data; | ||
1846 | 1847 | ||
1847 | if (!card) { | 1848 | if (!card) { |
1848 | printk(KERN_ERR "capidrv: if_sendbuf called with invalid driverId %d!\n", | 1849 | printk(KERN_ERR "capidrv: if_sendbuf called with invalid driverId %d!\n", |
@@ -1860,9 +1861,26 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) | |||
1860 | return 0; | 1861 | return 0; |
1861 | } | 1862 | } |
1862 | datahandle = nccip->datahandle; | 1863 | datahandle = nccip->datahandle; |
1864 | |||
1865 | /* | ||
1866 | * Here we copy pointer skb->data into the 32-bit 'Data' field. | ||
1867 | * The 'Data' field is not used in practice in linux kernel | ||
1868 | * (neither in 32 or 64 bit), but should have some value, | ||
1869 | * since a CAPI message trace will display it. | ||
1870 | * | ||
1871 | * The correct value in the 32 bit case is the address of the | ||
1872 | * data, in 64 bit it makes no sense, we use 0 there. | ||
1873 | */ | ||
1874 | |||
1875 | #ifdef CONFIG_64BIT | ||
1876 | data = 0; | ||
1877 | #else | ||
1878 | data = (unsigned long) skb->data; | ||
1879 | #endif | ||
1880 | |||
1863 | capi_fill_DATA_B3_REQ(&sendcmsg, global.ap.applid, card->msgid++, | 1881 | capi_fill_DATA_B3_REQ(&sendcmsg, global.ap.applid, card->msgid++, |
1864 | nccip->ncci, /* adr */ | 1882 | nccip->ncci, /* adr */ |
1865 | (u32) skb->data, /* Data */ | 1883 | data, /* Data */ |
1866 | skb->len, /* DataLength */ | 1884 | skb->len, /* DataLength */ |
1867 | datahandle, /* DataHandle */ | 1885 | datahandle, /* DataHandle */ |
1868 | 0 /* Flags */ | 1886 | 0 /* Flags */ |
@@ -2123,7 +2141,10 @@ static int capidrv_delcontr(u16 contr) | |||
2123 | printk(KERN_ERR "capidrv: delcontr: no contr %u\n", contr); | 2141 | printk(KERN_ERR "capidrv: delcontr: no contr %u\n", contr); |
2124 | return -1; | 2142 | return -1; |
2125 | } | 2143 | } |
2126 | #warning FIXME: maybe a race condition the card should be removed here from global list /kkeil | 2144 | |
2145 | /* FIXME: maybe a race condition the card should be removed | ||
2146 | * here from global list /kkeil | ||
2147 | */ | ||
2127 | spin_unlock_irqrestore(&global_lock, flags); | 2148 | spin_unlock_irqrestore(&global_lock, flags); |
2128 | 2149 | ||
2129 | del_timer(&card->listentimer); | 2150 | del_timer(&card->listentimer); |