aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/act2000/module.c3
-rw-r--r--drivers/isdn/capi/capi.c13
-rw-r--r--drivers/isdn/capi/capidrv.c9
-rw-r--r--drivers/isdn/gigaset/Kconfig1
-rw-r--r--drivers/isdn/gigaset/asyncdata.c5
-rw-r--r--drivers/isdn/gigaset/common.c37
-rw-r--r--drivers/isdn/gigaset/gigaset.h4
-rw-r--r--drivers/isdn/gigaset/interface.c4
-rw-r--r--drivers/isdn/gigaset/isocdata.c5
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c3
-rw-r--r--drivers/isdn/hardware/avm/b1.c10
-rw-r--r--drivers/isdn/hardware/avm/t1isa.c1
-rw-r--r--drivers/isdn/hardware/eicon/debug.c4
-rw-r--r--drivers/isdn/hardware/eicon/di.c8
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c2
-rw-r--r--drivers/isdn/hardware/eicon/io.c2
-rw-r--r--drivers/isdn/hardware/eicon/istream.c4
-rw-r--r--drivers/isdn/hardware/eicon/platform.h8
-rw-r--r--drivers/isdn/hisax/Kconfig8
-rw-r--r--drivers/isdn/hisax/avma1_cs.c3
-rw-r--r--drivers/isdn/hisax/config.c21
-rw-r--r--drivers/isdn/hisax/diva.c4
-rw-r--r--drivers/isdn/hisax/elsa_cs.c3
-rw-r--r--drivers/isdn/hisax/fsm.c4
-rw-r--r--drivers/isdn/hisax/hfc4s8s_l1.c3
-rw-r--r--drivers/isdn/hisax/hfc_pci.c10
-rw-r--r--drivers/isdn/hisax/hfc_usb.c3
-rw-r--r--drivers/isdn/hisax/hisax.h6
-rw-r--r--drivers/isdn/hisax/hisax_fcpcipnp.c4
-rw-r--r--drivers/isdn/hisax/hisax_isac.c2
-rw-r--r--drivers/isdn/hisax/isdnhdlc.c25
-rw-r--r--drivers/isdn/hisax/isdnhdlc.h2
-rw-r--r--drivers/isdn/hisax/sedlbauer.c4
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c3
-rw-r--r--drivers/isdn/hisax/st5481_b.c3
-rw-r--r--drivers/isdn/hisax/st5481_d.c4
-rw-r--r--drivers/isdn/hisax/st5481_init.c4
-rw-r--r--drivers/isdn/hisax/teles_cs.c3
-rw-r--r--drivers/isdn/hysdn/hycapi.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_boot.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_init.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_net.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c7
-rw-r--r--drivers/isdn/i4l/isdn_bsdcomp.c4
-rw-r--r--drivers/isdn/i4l/isdn_common.c15
-rw-r--r--drivers/isdn/i4l/isdn_net.c6
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c21
-rw-r--r--drivers/isdn/i4l/isdn_tty.c2
-rw-r--r--drivers/isdn/i4l/isdn_v110.c3
-rw-r--r--drivers/isdn/icn/icn.c3
-rw-r--r--drivers/isdn/isdnloop/isdnloop.c3
-rw-r--r--drivers/isdn/pcbit/drv.c9
-rw-r--r--drivers/isdn/pcbit/layer2.c3
-rw-r--r--drivers/isdn/sc/init.c9
54 files changed, 99 insertions, 240 deletions
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c
index 90593e2ef872..e3e5c1399076 100644
--- a/drivers/isdn/act2000/module.c
+++ b/drivers/isdn/act2000/module.c
@@ -573,12 +573,11 @@ act2000_alloccard(int bus, int port, int irq, char *id)
573{ 573{
574 int i; 574 int i;
575 act2000_card *card; 575 act2000_card *card;
576 if (!(card = (act2000_card *) kmalloc(sizeof(act2000_card), GFP_KERNEL))) { 576 if (!(card = kzalloc(sizeof(act2000_card), GFP_KERNEL))) {
577 printk(KERN_WARNING 577 printk(KERN_WARNING
578 "act2000: (%s) Could not allocate card-struct.\n", id); 578 "act2000: (%s) Could not allocate card-struct.\n", id);
579 return; 579 return;
580 } 580 }
581 memset((char *) card, 0, sizeof(act2000_card));
582 spin_lock_init(&card->lock); 581 spin_lock_init(&card->lock);
583 spin_lock_init(&card->mnlock); 582 spin_lock_init(&card->mnlock);
584 skb_queue_head_init(&card->sndq); 583 skb_queue_head_init(&card->sndq);
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 11844bbfe933..d22c0224fde6 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -215,13 +215,12 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
215 unsigned int minor = 0; 215 unsigned int minor = 0;
216 unsigned long flags; 216 unsigned long flags;
217 217
218 mp = kmalloc(sizeof(*mp), GFP_ATOMIC); 218 mp = kzalloc(sizeof(*mp), GFP_ATOMIC);
219 if (!mp) { 219 if (!mp) {
220 printk(KERN_ERR "capi: can't alloc capiminor\n"); 220 printk(KERN_ERR "capi: can't alloc capiminor\n");
221 return NULL; 221 return NULL;
222 } 222 }
223 223
224 memset(mp, 0, sizeof(struct capiminor));
225 mp->ap = ap; 224 mp->ap = ap;
226 mp->ncci = ncci; 225 mp->ncci = ncci;
227 mp->msgid = 0; 226 mp->msgid = 0;
@@ -304,10 +303,9 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
304 struct capiminor *mp = NULL; 303 struct capiminor *mp = NULL;
305#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 304#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
306 305
307 np = kmalloc(sizeof(*np), GFP_ATOMIC); 306 np = kzalloc(sizeof(*np), GFP_ATOMIC);
308 if (!np) 307 if (!np)
309 return NULL; 308 return NULL;
310 memset(np, 0, sizeof(struct capincci));
311 np->ncci = ncci; 309 np->ncci = ncci;
312 np->cdev = cdev; 310 np->cdev = cdev;
313#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 311#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
@@ -384,10 +382,9 @@ static struct capidev *capidev_alloc(void)
384 struct capidev *cdev; 382 struct capidev *cdev;
385 unsigned long flags; 383 unsigned long flags;
386 384
387 cdev = kmalloc(sizeof(*cdev), GFP_KERNEL); 385 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
388 if (!cdev) 386 if (!cdev)
389 return NULL; 387 return NULL;
390 memset(cdev, 0, sizeof(struct capidev));
391 388
392 init_MUTEX(&cdev->ncci_list_sem); 389 init_MUTEX(&cdev->ncci_list_sem);
393 skb_queue_head_init(&cdev->recvqueue); 390 skb_queue_head_init(&cdev->recvqueue);
@@ -1010,7 +1007,7 @@ static int capinc_tty_open(struct tty_struct * tty, struct file * file)
1010{ 1007{
1011 struct capiminor *mp; 1008 struct capiminor *mp;
1012 1009
1013 if ((mp = capiminor_find(iminor(file->f_dentry->d_inode))) == 0) 1010 if ((mp = capiminor_find(iminor(file->f_path.dentry->d_inode))) == 0)
1014 return -ENXIO; 1011 return -ENXIO;
1015 if (mp->nccip == 0) 1012 if (mp->nccip == 0)
1016 return -ENXIO; 1013 return -ENXIO;
@@ -1203,7 +1200,7 @@ static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
1203 return error; 1200 return error;
1204} 1201}
1205 1202
1206static void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old) 1203static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
1207{ 1204{
1208#ifdef _DEBUG_TTYFUNCS 1205#ifdef _DEBUG_TTYFUNCS
1209 printk(KERN_DEBUG "capinc_tty_set_termios\n"); 1206 printk(KERN_DEBUG "capinc_tty_set_termios\n");
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index b6f9476c0501..097bfa7bc323 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -334,12 +334,11 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
334{ 334{
335 capidrv_plci *plcip; 335 capidrv_plci *plcip;
336 336
337 plcip = (capidrv_plci *) kmalloc(sizeof(capidrv_plci), GFP_ATOMIC); 337 plcip = kzalloc(sizeof(capidrv_plci), GFP_ATOMIC);
338 338
339 if (plcip == 0) 339 if (plcip == 0)
340 return NULL; 340 return NULL;
341 341
342 memset(plcip, 0, sizeof(capidrv_plci));
343 plcip->state = ST_PLCI_NONE; 342 plcip->state = ST_PLCI_NONE;
344 plcip->plci = 0; 343 plcip->plci = 0;
345 plcip->msgid = 0; 344 plcip->msgid = 0;
@@ -404,12 +403,11 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
404{ 403{
405 capidrv_ncci *nccip; 404 capidrv_ncci *nccip;
406 405
407 nccip = (capidrv_ncci *) kmalloc(sizeof(capidrv_ncci), GFP_ATOMIC); 406 nccip = kzalloc(sizeof(capidrv_ncci), GFP_ATOMIC);
408 407
409 if (nccip == 0) 408 if (nccip == 0)
410 return NULL; 409 return NULL;
411 410
412 memset(nccip, 0, sizeof(capidrv_ncci));
413 nccip->ncci = ncci; 411 nccip->ncci = ncci;
414 nccip->state = ST_NCCI_NONE; 412 nccip->state = ST_NCCI_NONE;
415 nccip->plcip = plcip; 413 nccip->plcip = plcip;
@@ -2005,12 +2003,11 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
2005 printk(KERN_WARNING "capidrv: (%s) Could not reserve module\n", id); 2003 printk(KERN_WARNING "capidrv: (%s) Could not reserve module\n", id);
2006 return -1; 2004 return -1;
2007 } 2005 }
2008 if (!(card = (capidrv_contr *) kmalloc(sizeof(capidrv_contr), GFP_ATOMIC))) { 2006 if (!(card = kzalloc(sizeof(capidrv_contr), GFP_ATOMIC))) {
2009 printk(KERN_WARNING 2007 printk(KERN_WARNING
2010 "capidrv: (%s) Could not allocate contr-struct.\n", id); 2008 "capidrv: (%s) Could not allocate contr-struct.\n", id);
2011 return -1; 2009 return -1;
2012 } 2010 }
2013 memset(card, 0, sizeof(capidrv_contr));
2014 card->owner = THIS_MODULE; 2011 card->owner = THIS_MODULE;
2015 init_timer(&card->listentimer); 2012 init_timer(&card->listentimer);
2016 strcpy(card->name, id); 2013 strcpy(card->name, id);
diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig
index 5b203fe21dcd..708d47a6484b 100644
--- a/drivers/isdn/gigaset/Kconfig
+++ b/drivers/isdn/gigaset/Kconfig
@@ -5,6 +5,7 @@ config ISDN_DRV_GIGASET
5 tristate "Siemens Gigaset support (isdn)" 5 tristate "Siemens Gigaset support (isdn)"
6 depends on ISDN_I4L 6 depends on ISDN_I4L
7 select CRC_CCITT 7 select CRC_CCITT
8 select BITREVERSE
8 help 9 help
9 Say m here if you have a Gigaset or Sinus isdn device. 10 Say m here if you have a Gigaset or Sinus isdn device.
10 11
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index ce3cd77094b3..88e958f176d2 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -15,6 +15,7 @@
15 15
16#include "gigaset.h" 16#include "gigaset.h"
17#include <linux/crc-ccitt.h> 17#include <linux/crc-ccitt.h>
18#include <linux/bitrev.h>
18 19
19//#define GIG_M10x_STUFF_VOICE_DATA 20//#define GIG_M10x_STUFF_VOICE_DATA
20 21
@@ -302,7 +303,7 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
302 inputstate |= INS_skip_frame; 303 inputstate |= INS_skip_frame;
303 break; 304 break;
304 } 305 }
305 *__skb_put(skb, 1) = gigaset_invtab[c]; 306 *__skb_put(skb, 1) = bitrev8(c);
306 } 307 }
307 308
308 if (unlikely(!numbytes)) 309 if (unlikely(!numbytes))
@@ -543,7 +544,7 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb, int head, int tail)
543 cp = skb->data; 544 cp = skb->data;
544 len = skb->len; 545 len = skb->len;
545 while (len--) { 546 while (len--) {
546 c = gigaset_invtab[*cp++]; 547 c = bitrev8(*cp++);
547 if (c == DLE_FLAG) 548 if (c == DLE_FLAG)
548 *(skb_put(iraw_skb, 1)) = c; 549 *(skb_put(iraw_skb, 1)) = c;
549 *(skb_put(iraw_skb, 1)) = c; 550 *(skb_put(iraw_skb, 1)) = c;
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index defd5743dba6..95eff3b2917a 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -33,43 +33,6 @@ MODULE_PARM_DESC(debug, "debug level");
33#define VALID_ID 0x02 33#define VALID_ID 0x02
34#define ASSIGNED 0x04 34#define ASSIGNED 0x04
35 35
36/* bitwise byte inversion table */
37__u8 gigaset_invtab[256] = {
38 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
39 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
40 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
41 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
42 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
43 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
44 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
45 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
46 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
47 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
48 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
49 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
50 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
51 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
52 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
53 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
54 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
55 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
56 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
57 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
58 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
59 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
60 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
61 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
62 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
63 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
64 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
65 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
66 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
67 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
68 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
69 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
70};
71EXPORT_SYMBOL_GPL(gigaset_invtab);
72
73void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, 36void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
74 size_t len, const unsigned char *buf) 37 size_t len, const unsigned char *buf)
75{ 38{
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index 06298cc52bf5..a0317abaeb11 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -876,10 +876,6 @@ static inline void gigaset_rcv_error(struct sk_buff *procskb,
876 } 876 }
877} 877}
878 878
879
880/* bitwise byte inversion table */
881extern __u8 gigaset_invtab[]; /* in common.c */
882
883/* append received bytes to inbuf */ 879/* append received bytes to inbuf */
884int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, 880int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
885 unsigned numbytes); 881 unsigned numbytes);
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 7edea015867e..458b6462f937 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -127,7 +127,7 @@ static int if_write_room(struct tty_struct *tty);
127static int if_chars_in_buffer(struct tty_struct *tty); 127static int if_chars_in_buffer(struct tty_struct *tty);
128static void if_throttle(struct tty_struct *tty); 128static void if_throttle(struct tty_struct *tty);
129static void if_unthrottle(struct tty_struct *tty); 129static void if_unthrottle(struct tty_struct *tty);
130static void if_set_termios(struct tty_struct *tty, struct termios *old); 130static void if_set_termios(struct tty_struct *tty, struct ktermios *old);
131static int if_tiocmget(struct tty_struct *tty, struct file *file); 131static int if_tiocmget(struct tty_struct *tty, struct file *file);
132static int if_tiocmset(struct tty_struct *tty, struct file *file, 132static int if_tiocmset(struct tty_struct *tty, struct file *file,
133 unsigned int set, unsigned int clear); 133 unsigned int set, unsigned int clear);
@@ -490,7 +490,7 @@ static void if_unthrottle(struct tty_struct *tty)
490 mutex_unlock(&cs->mutex); 490 mutex_unlock(&cs->mutex);
491} 491}
492 492
493static void if_set_termios(struct tty_struct *tty, struct termios *old) 493static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
494{ 494{
495 struct cardstate *cs; 495 struct cardstate *cs;
496 unsigned int iflag; 496 unsigned int iflag;
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index 8667daaa1a82..df988eb0e36f 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -14,6 +14,7 @@
14 14
15#include "gigaset.h" 15#include "gigaset.h"
16#include <linux/crc-ccitt.h> 16#include <linux/crc-ccitt.h>
17#include <linux/bitrev.h>
17 18
18/* access methods for isowbuf_t */ 19/* access methods for isowbuf_t */
19/* ============================ */ 20/* ============================ */
@@ -487,7 +488,7 @@ static inline int trans_buildframe(struct isowbuf_t *iwb,
487 gig_dbg(DEBUG_STREAM, "put %d bytes", count); 488 gig_dbg(DEBUG_STREAM, "put %d bytes", count);
488 write = atomic_read(&iwb->write); 489 write = atomic_read(&iwb->write);
489 do { 490 do {
490 c = gigaset_invtab[*in++]; 491 c = bitrev8(*in++);
491 iwb->data[write++] = c; 492 iwb->data[write++] = c;
492 write %= BAS_OUTBUFSIZE; 493 write %= BAS_OUTBUFSIZE;
493 } while (--count > 0); 494 } while (--count > 0);
@@ -876,7 +877,7 @@ static inline void trans_receive(unsigned char *src, unsigned count,
876 while (count > 0) { 877 while (count > 0) {
877 dst = skb_put(skb, count < dobytes ? count : dobytes); 878 dst = skb_put(skb, count < dobytes ? count : dobytes);
878 while (count > 0 && dobytes > 0) { 879 while (count > 0 && dobytes > 0) {
879 *dst++ = gigaset_invtab[*src++]; 880 *dst++ = bitrev8(*src++);
880 count--; 881 count--;
881 dobytes--; 882 dobytes--;
882 } 883 }
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index fd5d7364a487..eba10466ccc6 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -121,10 +121,9 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
121 p_dev->conf.Present = PRESENT_OPTION; 121 p_dev->conf.Present = PRESENT_OPTION;
122 122
123 /* Allocate space for private device-specific data */ 123 /* Allocate space for private device-specific data */
124 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 124 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
125 if (!local) 125 if (!local)
126 goto err; 126 goto err;
127 memset(local, 0, sizeof(local_info_t));
128 p_dev->priv = local; 127 p_dev->priv = local;
129 128
130 return avmcs_config(p_dev); 129 return avmcs_config(p_dev);
diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
index da2729247713..7a69a18d07e2 100644
--- a/drivers/isdn/hardware/avm/b1.c
+++ b/drivers/isdn/hardware/avm/b1.c
@@ -65,18 +65,15 @@ avmcard *b1_alloc_card(int nr_controllers)
65 avmctrl_info *cinfo; 65 avmctrl_info *cinfo;
66 int i; 66 int i;
67 67
68 card = kmalloc(sizeof(*card), GFP_KERNEL); 68 card = kzalloc(sizeof(*card), GFP_KERNEL);
69 if (!card) 69 if (!card)
70 return NULL; 70 return NULL;
71 71
72 memset(card, 0, sizeof(*card)); 72 cinfo = kzalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL);
73
74 cinfo = kmalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL);
75 if (!cinfo) { 73 if (!cinfo) {
76 kfree(card); 74 kfree(card);
77 return NULL; 75 return NULL;
78 } 76 }
79 memset(cinfo, 0, sizeof(*cinfo) * nr_controllers);
80 77
81 card->ctrlinfo = cinfo; 78 card->ctrlinfo = cinfo;
82 for (i = 0; i < nr_controllers; i++) { 79 for (i = 0; i < nr_controllers; i++) {
@@ -718,12 +715,11 @@ avmcard_dma_alloc(char *name, struct pci_dev *pdev, long rsize, long ssize)
718 avmcard_dmainfo *p; 715 avmcard_dmainfo *p;
719 void *buf; 716 void *buf;
720 717
721 p = kmalloc(sizeof(avmcard_dmainfo), GFP_KERNEL); 718 p = kzalloc(sizeof(avmcard_dmainfo), GFP_KERNEL);
722 if (!p) { 719 if (!p) {
723 printk(KERN_WARNING "%s: no memory.\n", name); 720 printk(KERN_WARNING "%s: no memory.\n", name);
724 goto err; 721 goto err;
725 } 722 }
726 memset(p, 0, sizeof(avmcard_dmainfo));
727 723
728 p->recvbuf.size = rsize; 724 p->recvbuf.size = rsize;
729 buf = pci_alloc_consistent(pdev, rsize, &p->recvbuf.dmaaddr); 725 buf = pci_alloc_consistent(pdev, rsize, &p->recvbuf.dmaaddr);
diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c
index e47c60b0a8ec..c925020fe9b7 100644
--- a/drivers/isdn/hardware/avm/t1isa.c
+++ b/drivers/isdn/hardware/avm/t1isa.c
@@ -584,6 +584,7 @@ static void __exit t1isa_exit(void)
584{ 584{
585 int i; 585 int i;
586 586
587 unregister_capi_driver(&capi_driver_t1isa);
587 for (i = 0; i < MAX_CARDS; i++) { 588 for (i = 0; i < MAX_CARDS; i++) {
588 if (!io[i]) 589 if (!io[i])
589 break; 590 break;
diff --git a/drivers/isdn/hardware/eicon/debug.c b/drivers/isdn/hardware/eicon/debug.c
index 6851c6270ce8..d835e74ecf18 100644
--- a/drivers/isdn/hardware/eicon/debug.c
+++ b/drivers/isdn/hardware/eicon/debug.c
@@ -756,14 +756,14 @@ int diva_get_driver_info (dword id, byte* data, int data_length) {
756 756
757 data_length -= 9; 757 data_length -= 9;
758 758
759 if ((to_copy = MIN(strlen(clients[id].drvName), data_length-1))) { 759 if ((to_copy = min(strlen(clients[id].drvName), (size_t)(data_length-1)))) {
760 memcpy (p, clients[id].drvName, to_copy); 760 memcpy (p, clients[id].drvName, to_copy);
761 p += to_copy; 761 p += to_copy;
762 data_length -= to_copy; 762 data_length -= to_copy;
763 if ((data_length >= 4) && clients[id].hDbg->drvTag[0]) { 763 if ((data_length >= 4) && clients[id].hDbg->drvTag[0]) {
764 *p++ = '('; 764 *p++ = '(';
765 data_length -= 1; 765 data_length -= 1;
766 if ((to_copy = MIN(strlen(clients[id].hDbg->drvTag), data_length-2))) { 766 if ((to_copy = min(strlen(clients[id].hDbg->drvTag), (size_t)(data_length-2)))) {
767 memcpy (p, clients[id].hDbg->drvTag, to_copy); 767 memcpy (p, clients[id].hDbg->drvTag, to_copy);
768 p += to_copy; 768 p += to_copy;
769 data_length -= to_copy; 769 data_length -= to_copy;
diff --git a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c
index 0617d7cabf06..e1df8d98c311 100644
--- a/drivers/isdn/hardware/eicon/di.c
+++ b/drivers/isdn/hardware/eicon/di.c
@@ -133,7 +133,7 @@ void pr_out(ADAPTER * a)
133 i = this->XCurrent; 133 i = this->XCurrent;
134 X = PTR_X(a,this); 134 X = PTR_X(a,this);
135 while(i<this->XNum && length<270) { 135 while(i<this->XNum && length<270) {
136 clength = MIN((word)(270-length),X[i].PLength-this->XOffset); 136 clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset));
137 a->ram_out_buffer(a, 137 a->ram_out_buffer(a,
138 &ReqOut->XBuffer.P[length], 138 &ReqOut->XBuffer.P[length],
139 PTR_P(a,this,&X[i].P[this->XOffset]), 139 PTR_P(a,this,&X[i].P[this->XOffset]),
@@ -622,7 +622,7 @@ byte isdn_ind(ADAPTER * a,
622 sizeof(a->stream_buffer), 622 sizeof(a->stream_buffer),
623 &final, NULL, NULL); 623 &final, NULL, NULL);
624 } 624 }
625 IoAdapter->RBuffer.length = MIN(MLength, 270); 625 IoAdapter->RBuffer.length = min(MLength, (word)270);
626 if (IoAdapter->RBuffer.length != MLength) { 626 if (IoAdapter->RBuffer.length != MLength) {
627 this->complete = 0; 627 this->complete = 0;
628 } else { 628 } else {
@@ -676,9 +676,9 @@ byte isdn_ind(ADAPTER * a,
676 this->RCurrent++; 676 this->RCurrent++;
677 } 677 }
678 if (cma) { 678 if (cma) {
679 clength = MIN(MLength, R[this->RCurrent].PLength-this->ROffset); 679 clength = min(MLength, (word)(R[this->RCurrent].PLength-this->ROffset));
680 } else { 680 } else {
681 clength = MIN(a->ram_inw(a, &RBuffer->length)-offset, 681 clength = min(a->ram_inw(a, &RBuffer->length)-offset,
682 R[this->RCurrent].PLength-this->ROffset); 682 R[this->RCurrent].PLength-this->ROffset);
683 } 683 }
684 if(R[this->RCurrent].P) { 684 if(R[this->RCurrent].P) {
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index dae2e83dd5e8..91fc92c01afe 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -185,7 +185,7 @@ void diva_log_info(unsigned char *format, ...)
185 unsigned char line[160]; 185 unsigned char line[160];
186 186
187 va_start(args, format); 187 va_start(args, format);
188 vsprintf(line, format, args); 188 vsnprintf(line, sizeof(line), format, args);
189 va_end(args); 189 va_end(args);
190 190
191 printk(KERN_INFO "%s: %s\n", DRIVERLNAME, line); 191 printk(KERN_INFO "%s: %s\n", DRIVERLNAME, line);
diff --git a/drivers/isdn/hardware/eicon/io.c b/drivers/isdn/hardware/eicon/io.c
index 4a27e230b0a5..6fd9b007417d 100644
--- a/drivers/isdn/hardware/eicon/io.c
+++ b/drivers/isdn/hardware/eicon/io.c
@@ -262,7 +262,7 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e)
262 case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: { 262 case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: {
263 diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info; 263 diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info;
264 memset (&prms, 0x00, sizeof(prms)); 264 memset (&prms, 0x00, sizeof(prms));
265 prms.structure_length = MIN(sizeof(prms), pI->structure_length); 265 prms.structure_length = min_t(size_t, sizeof(prms), pI->structure_length);
266 memset (pI, 0x00, pI->structure_length); 266 memset (pI, 0x00, pI->structure_length);
267 prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \ 267 prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \
268 DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0; 268 DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0;
diff --git a/drivers/isdn/hardware/eicon/istream.c b/drivers/isdn/hardware/eicon/istream.c
index 23139668d9b1..18f8798442fa 100644
--- a/drivers/isdn/hardware/eicon/istream.c
+++ b/drivers/isdn/hardware/eicon/istream.c
@@ -92,7 +92,7 @@ int diva_istream_write (void* context,
92 return (-1); /* was not able to write */ 92 return (-1); /* was not able to write */
93 break; /* only part of message was written */ 93 break; /* only part of message was written */
94 } 94 }
95 to_write = MIN(length, DIVA_DFIFO_DATA_SZ); 95 to_write = min(length, DIVA_DFIFO_DATA_SZ);
96 if (to_write) { 96 if (to_write) {
97 a->ram_out_buffer (a, 97 a->ram_out_buffer (a,
98#ifdef PLATFORM_GT_32BIT 98#ifdef PLATFORM_GT_32BIT
@@ -176,7 +176,7 @@ int diva_istream_read (void* context,
176 return (-1); /* was not able to read */ 176 return (-1); /* was not able to read */
177 break; 177 break;
178 } 178 }
179 to_read = MIN(max_length, tmp[1]); 179 to_read = min(max_length, (int)tmp[1]);
180 if (to_read) { 180 if (to_read) {
181 a->ram_in_buffer(a, 181 a->ram_in_buffer(a,
182#ifdef PLATFORM_GT_32BIT 182#ifdef PLATFORM_GT_32BIT
diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h
index a66836cf756c..2444811e0b38 100644
--- a/drivers/isdn/hardware/eicon/platform.h
+++ b/drivers/isdn/hardware/eicon/platform.h
@@ -83,14 +83,6 @@
83#define NULL ((void *) 0) 83#define NULL ((void *) 0)
84#endif 84#endif
85 85
86#ifndef MIN
87#define MIN(a,b) ((a)>(b) ? (b) : (a))
88#endif
89
90#ifndef MAX
91#define MAX(a,b) ((a)>(b) ? (a) : (b))
92#endif
93
94#ifndef far 86#ifndef far
95#define far 87#define far
96#endif 88#endif
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
index cfd2718a490d..6fa12cc8e4ff 100644
--- a/drivers/isdn/hisax/Kconfig
+++ b/drivers/isdn/hisax/Kconfig
@@ -349,13 +349,6 @@ config HISAX_ENTERNOW_PCI
349 This enables HiSax support for the Formula-n enter:now PCI 349 This enables HiSax support for the Formula-n enter:now PCI
350 ISDN card. 350 ISDN card.
351 351
352config HISAX_AMD7930
353 bool "Am7930 (EXPERIMENTAL)"
354 depends on EXPERIMENTAL && SPARC && BROKEN
355 help
356 This enables HiSax support for the AMD7930 chips on some SPARCs.
357 This code is not finished yet.
358
359endif 352endif
360 353
361if ISDN_DRV_HISAX 354if ISDN_DRV_HISAX
@@ -402,6 +395,7 @@ config HISAX_ST5481
402 tristate "ST5481 USB ISDN modem (EXPERIMENTAL)" 395 tristate "ST5481 USB ISDN modem (EXPERIMENTAL)"
403 depends on USB && EXPERIMENTAL 396 depends on USB && EXPERIMENTAL
404 select CRC_CCITT 397 select CRC_CCITT
398 select BITREVERSE
405 help 399 help
406 This enables the driver for ST5481 based USB ISDN adapters, 400 This enables the driver for ST5481 based USB ISDN adapters,
407 e.g. the BeWan Gazel 128 USB 401 e.g. the BeWan Gazel 128 USB
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 876fec6c6be8..9e70c206779e 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -123,11 +123,10 @@ static int avma1cs_probe(struct pcmcia_device *p_dev)
123 DEBUG(0, "avma1cs_attach()\n"); 123 DEBUG(0, "avma1cs_attach()\n");
124 124
125 /* Allocate space for private device-specific data */ 125 /* Allocate space for private device-specific data */
126 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 126 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
127 if (!local) 127 if (!local)
128 return -ENOMEM; 128 return -ENOMEM;
129 129
130 memset(local, 0, sizeof(local_info_t));
131 p_dev->priv = local; 130 p_dev->priv = local;
132 131
133 /* The io structure describes IO port mapping */ 132 /* The io structure describes IO port mapping */
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index cede72cdbb31..17ec0b70ba1d 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -227,14 +227,6 @@ const char *CardType[] = {
227#define DEFAULT_CFG {5,0x2E0,0,0} 227#define DEFAULT_CFG {5,0x2E0,0,0}
228#endif 228#endif
229 229
230
231#ifdef CONFIG_HISAX_AMD7930
232#undef DEFAULT_CARD
233#undef DEFAULT_CFG
234#define DEFAULT_CARD ISDN_CTYPE_AMD7930
235#define DEFAULT_CFG {12,0x3e0,0,0}
236#endif
237
238#ifdef CONFIG_HISAX_NICCY 230#ifdef CONFIG_HISAX_NICCY
239#undef DEFAULT_CARD 231#undef DEFAULT_CARD
240#undef DEFAULT_CFG 232#undef DEFAULT_CFG
@@ -545,10 +537,6 @@ extern int setup_hfcpci(struct IsdnCard *card);
545extern int setup_hfcsx(struct IsdnCard *card); 537extern int setup_hfcsx(struct IsdnCard *card);
546#endif 538#endif
547 539
548#if CARD_AMD7930
549extern int setup_amd7930(struct IsdnCard *card);
550#endif
551
552#if CARD_NICCY 540#if CARD_NICCY
553extern int setup_niccy(struct IsdnCard *card); 541extern int setup_niccy(struct IsdnCard *card);
554#endif 542#endif
@@ -869,14 +857,13 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow
869 struct IsdnCard *card = cards + cardnr; 857 struct IsdnCard *card = cards + cardnr;
870 struct IsdnCardState *cs; 858 struct IsdnCardState *cs;
871 859
872 cs = kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC); 860 cs = kzalloc(sizeof(struct IsdnCardState), GFP_ATOMIC);
873 if (!cs) { 861 if (!cs) {
874 printk(KERN_WARNING 862 printk(KERN_WARNING
875 "HiSax: No memory for IsdnCardState(card %d)\n", 863 "HiSax: No memory for IsdnCardState(card %d)\n",
876 cardnr + 1); 864 cardnr + 1);
877 goto out; 865 goto out;
878 } 866 }
879 memset(cs, 0, sizeof(struct IsdnCardState));
880 card->cs = cs; 867 card->cs = cs;
881 spin_lock_init(&cs->statlock); 868 spin_lock_init(&cs->statlock);
882 spin_lock_init(&cs->lock); 869 spin_lock_init(&cs->lock);
@@ -1064,11 +1051,6 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow
1064 ret = setup_niccy(card); 1051 ret = setup_niccy(card);
1065 break; 1052 break;
1066#endif 1053#endif
1067#if CARD_AMD7930
1068 case ISDN_CTYPE_AMD7930:
1069 ret = setup_amd7930(card);
1070 break;
1071#endif
1072#if CARD_ISURF 1054#if CARD_ISURF
1073 case ISDN_CTYPE_ISURF: 1055 case ISDN_CTYPE_ISURF:
1074 ret = setup_isurf(card); 1056 ret = setup_isurf(card);
@@ -1437,7 +1419,6 @@ static int __init HiSax_init(void)
1437 break; 1419 break;
1438 case ISDN_CTYPE_ELSA_PCI: 1420 case ISDN_CTYPE_ELSA_PCI:
1439 case ISDN_CTYPE_NETJET_S: 1421 case ISDN_CTYPE_NETJET_S:
1440 case ISDN_CTYPE_AMD7930:
1441 case ISDN_CTYPE_TELESPCI: 1422 case ISDN_CTYPE_TELESPCI:
1442 case ISDN_CTYPE_W6692: 1423 case ISDN_CTYPE_W6692:
1443 case ISDN_CTYPE_NETJET_U: 1424 case ISDN_CTYPE_NETJET_U:
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 3dacfff93f5f..6eebeb441bfd 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -1121,7 +1121,11 @@ setup_diva(struct IsdnCard *card)
1121 bytecnt = 32; 1121 bytecnt = 32;
1122 } 1122 }
1123 } 1123 }
1124
1125#ifdef __ISAPNP__
1124ready: 1126ready:
1127#endif
1128
1125 printk(KERN_INFO 1129 printk(KERN_INFO
1126 "Diva: %s card configured at %#lx IRQ %d\n", 1130 "Diva: %s card configured at %#lx IRQ %d\n",
1127 (cs->subtyp == DIVA_PCI) ? "PCI" : 1131 (cs->subtyp == DIVA_PCI) ? "PCI" :
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 4e180d210faa..79ab9dda7d08 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -146,9 +146,8 @@ static int elsa_cs_probe(struct pcmcia_device *link)
146 DEBUG(0, "elsa_cs_attach()\n"); 146 DEBUG(0, "elsa_cs_attach()\n");
147 147
148 /* Allocate space for private device-specific data */ 148 /* Allocate space for private device-specific data */
149 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 149 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
150 if (!local) return -ENOMEM; 150 if (!local) return -ENOMEM;
151 memset(local, 0, sizeof(local_info_t));
152 151
153 local->p_dev = link; 152 local->p_dev = link;
154 link->priv = local; 153 link->priv = local;
diff --git a/drivers/isdn/hisax/fsm.c b/drivers/isdn/hisax/fsm.c
index 0d44a3f480ac..34fade96a581 100644
--- a/drivers/isdn/hisax/fsm.c
+++ b/drivers/isdn/hisax/fsm.c
@@ -26,12 +26,10 @@ FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
26 int i; 26 int i;
27 27
28 fsm->jumpmatrix = (FSMFNPTR *) 28 fsm->jumpmatrix = (FSMFNPTR *)
29 kmalloc(sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL); 29 kzalloc(sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL);
30 if (!fsm->jumpmatrix) 30 if (!fsm->jumpmatrix)
31 return -ENOMEM; 31 return -ENOMEM;
32 32
33 memset(fsm->jumpmatrix, 0, sizeof (FSMFNPTR) * fsm->state_count * fsm->event_count);
34
35 for (i = 0; i < fncount; i++) 33 for (i = 0; i < fncount; i++)
36 if ((fnlist[i].state>=fsm->state_count) || (fnlist[i].event>=fsm->event_count)) { 34 if ((fnlist[i].state>=fsm->state_count) || (fnlist[i].event>=fsm->event_count)) {
37 printk(KERN_ERR "FsmNew Error line %d st(%ld/%ld) ev(%ld/%ld)\n", 35 printk(KERN_ERR "FsmNew Error line %d st(%ld/%ld) ev(%ld/%ld)\n",
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index de9b1a4d6bac..a2fa4ecb8c88 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -1591,11 +1591,10 @@ hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1591 hfc4s8s_param *driver_data = (hfc4s8s_param *) ent->driver_data; 1591 hfc4s8s_param *driver_data = (hfc4s8s_param *) ent->driver_data;
1592 hfc4s8s_hw *hw; 1592 hfc4s8s_hw *hw;
1593 1593
1594 if (!(hw = kmalloc(sizeof(hfc4s8s_hw), GFP_ATOMIC))) { 1594 if (!(hw = kzalloc(sizeof(hfc4s8s_hw), GFP_ATOMIC))) {
1595 printk(KERN_ERR "No kmem for HFC-4S/8S card\n"); 1595 printk(KERN_ERR "No kmem for HFC-4S/8S card\n");
1596 return (err); 1596 return (err);
1597 } 1597 }
1598 memset(hw, 0, sizeof(hfc4s8s_hw));
1599 1598
1600 hw->pdev = pdev; 1599 hw->pdev = pdev;
1601 err = pci_enable_device(pdev); 1600 err = pci_enable_device(pdev);
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 5db0a85b827f..8a48a3ce0a55 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -1211,7 +1211,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
1211 break; 1211 break;
1212 case (HW_TESTLOOP | REQUEST): 1212 case (HW_TESTLOOP | REQUEST):
1213 spin_lock_irqsave(&cs->lock, flags); 1213 spin_lock_irqsave(&cs->lock, flags);
1214 switch ((int) arg) { 1214 switch ((long) arg) {
1215 case (1): 1215 case (1):
1216 Write_hfc(cs, HFCPCI_B1_SSL, 0x80); /* tx slot */ 1216 Write_hfc(cs, HFCPCI_B1_SSL, 0x80); /* tx slot */
1217 Write_hfc(cs, HFCPCI_B1_RSL, 0x80); /* rx slot */ 1217 Write_hfc(cs, HFCPCI_B1_RSL, 0x80); /* rx slot */
@@ -1229,7 +1229,7 @@ HFCPCI_l1hw(struct PStack *st, int pr, void *arg)
1229 default: 1229 default:
1230 spin_unlock_irqrestore(&cs->lock, flags); 1230 spin_unlock_irqrestore(&cs->lock, flags);
1231 if (cs->debug & L1_DEB_WARN) 1231 if (cs->debug & L1_DEB_WARN)
1232 debugl1(cs, "hfcpci_l1hw loop invalid %4x", (int) arg); 1232 debugl1(cs, "hfcpci_l1hw loop invalid %4lx", (long) arg);
1233 return; 1233 return;
1234 } 1234 }
1235 cs->hw.hfcpci.trm |= 0x80; /* enable IOM-loop */ 1235 cs->hw.hfcpci.trm |= 0x80; /* enable IOM-loop */
@@ -1711,9 +1711,9 @@ setup_hfcpci(struct IsdnCard *card)
1711 pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos)); 1711 pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos));
1712 cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256); 1712 cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256);
1713 printk(KERN_INFO 1713 printk(KERN_INFO
1714 "HFC-PCI: defined at mem %#x fifo %#x(%#x) IRQ %d HZ %d\n", 1714 "HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n",
1715 (u_int) cs->hw.hfcpci.pci_io, 1715 cs->hw.hfcpci.pci_io,
1716 (u_int) cs->hw.hfcpci.fifos, 1716 cs->hw.hfcpci.fifos,
1717 (u_int) virt_to_bus(cs->hw.hfcpci.fifos), 1717 (u_int) virt_to_bus(cs->hw.hfcpci.fifos),
1718 cs->irq, HZ); 1718 cs->irq, HZ);
1719 spin_lock_irqsave(&cs->lock, flags); 1719 spin_lock_irqsave(&cs->lock, flags);
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 7105b043add8..5a6989f23fcf 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -1481,9 +1481,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1481 iface = iface_used; 1481 iface = iface_used;
1482 if (! 1482 if (!
1483 (context = 1483 (context =
1484 kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) 1484 kzalloc(sizeof(hfcusb_data), GFP_KERNEL)))
1485 return (-ENOMEM); /* got no mem */ 1485 return (-ENOMEM); /* got no mem */
1486 memset(context, 0, sizeof(hfcusb_data));
1487 1486
1488 ep = iface->endpoint; 1487 ep = iface->endpoint;
1489 vcf = validconf[small_match]; 1488 vcf = validconf[small_match];
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 159c5896061e..3f1137e34678 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -1139,12 +1139,6 @@ struct IsdnCardState {
1139#define CARD_HFC_SX 0 1139#define CARD_HFC_SX 0
1140#endif 1140#endif
1141 1141
1142#ifdef CONFIG_HISAX_AMD7930
1143#define CARD_AMD7930 1
1144#else
1145#define CARD_AMD7930 0
1146#endif
1147
1148#ifdef CONFIG_HISAX_NICCY 1142#ifdef CONFIG_HISAX_NICCY
1149#define CARD_NICCY 1 1143#define CARD_NICCY 1
1150#ifndef ISDN_CHIP_ISAC 1144#ifndef ISDN_CHIP_ISAC
diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index f6db55a752c4..9e088fce8c3a 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -841,12 +841,10 @@ new_adapter(void)
841 struct hisax_b_if *b_if[2]; 841 struct hisax_b_if *b_if[2];
842 int i; 842 int i;
843 843
844 adapter = kmalloc(sizeof(struct fritz_adapter), GFP_KERNEL); 844 adapter = kzalloc(sizeof(struct fritz_adapter), GFP_KERNEL);
845 if (!adapter) 845 if (!adapter)
846 return NULL; 846 return NULL;
847 847
848 memset(adapter, 0, sizeof(struct fritz_adapter));
849
850 adapter->isac.hisax_d_if.owner = THIS_MODULE; 848 adapter->isac.hisax_d_if.owner = THIS_MODULE;
851 adapter->isac.hisax_d_if.ifc.priv = &adapter->isac; 849 adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
852 adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1; 850 adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
diff --git a/drivers/isdn/hisax/hisax_isac.c b/drivers/isdn/hisax/hisax_isac.c
index 81eac344bb03..d0fefcf999cb 100644
--- a/drivers/isdn/hisax/hisax_isac.c
+++ b/drivers/isdn/hisax/hisax_isac.c
@@ -433,7 +433,7 @@ static void l1m_debug(struct FsmInst *fi, char *fmt, ...)
433 char buf[256]; 433 char buf[256];
434 434
435 va_start(args, fmt); 435 va_start(args, fmt);
436 vsprintf(buf, fmt, args); 436 vsnprintf(buf, sizeof(buf), fmt, args);
437 DBG(DBG_L1M, "%s", buf); 437 DBG(DBG_L1M, "%s", buf);
438 va_end(args); 438 va_end(args);
439} 439}
diff --git a/drivers/isdn/hisax/isdnhdlc.c b/drivers/isdn/hisax/isdnhdlc.c
index cbdf54c5af84..268dced6c34a 100644
--- a/drivers/isdn/hisax/isdnhdlc.c
+++ b/drivers/isdn/hisax/isdnhdlc.c
@@ -35,30 +35,6 @@ MODULE_LICENSE("GPL");
35 35
36/*-------------------------------------------------------------------*/ 36/*-------------------------------------------------------------------*/
37 37
38/* bit swap table.
39 * Very handy for devices with different bit order,
40 * and neccessary for each transparent B-channel access for all
41 * devices which works with this HDLC decoder without bit reversal.
42 */
43const unsigned char isdnhdlc_bit_rev_tab[256] = {
44 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
45 0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
46 0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
47 0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
48 0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
49 0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
50 0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
51 0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
52 0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
53 0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
54 0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
55 0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
56 0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
57 0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
58 0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
59 0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF
60};
61
62enum { 38enum {
63 HDLC_FAST_IDLE,HDLC_GET_FLAG_B0,HDLC_GETFLAG_B1A6,HDLC_GETFLAG_B7, 39 HDLC_FAST_IDLE,HDLC_GET_FLAG_B0,HDLC_GETFLAG_B1A6,HDLC_GETFLAG_B7,
64 HDLC_GET_DATA,HDLC_FAST_FLAG 40 HDLC_GET_DATA,HDLC_FAST_FLAG
@@ -621,7 +597,6 @@ int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const unsigned char *src,
621 return len; 597 return len;
622} 598}
623 599
624EXPORT_SYMBOL(isdnhdlc_bit_rev_tab);
625EXPORT_SYMBOL(isdnhdlc_rcv_init); 600EXPORT_SYMBOL(isdnhdlc_rcv_init);
626EXPORT_SYMBOL(isdnhdlc_decode); 601EXPORT_SYMBOL(isdnhdlc_decode);
627EXPORT_SYMBOL(isdnhdlc_out_init); 602EXPORT_SYMBOL(isdnhdlc_out_init);
diff --git a/drivers/isdn/hisax/isdnhdlc.h b/drivers/isdn/hisax/isdnhdlc.h
index 5655b5f9c48e..45167d2f8fb0 100644
--- a/drivers/isdn/hisax/isdnhdlc.h
+++ b/drivers/isdn/hisax/isdnhdlc.h
@@ -57,8 +57,6 @@ struct isdnhdlc_vars {
57#define HDLC_CRC_ERROR 2 57#define HDLC_CRC_ERROR 2
58#define HDLC_LENGTH_ERROR 3 58#define HDLC_LENGTH_ERROR 3
59 59
60extern const unsigned char isdnhdlc_bit_rev_tab[256];
61
62extern void isdnhdlc_rcv_init (struct isdnhdlc_vars *hdlc, int do_adapt56); 60extern void isdnhdlc_rcv_init (struct isdnhdlc_vars *hdlc, int do_adapt56);
63 61
64extern int isdnhdlc_decode (struct isdnhdlc_vars *hdlc, const unsigned char *src, int slen,int *count, 62extern int isdnhdlc_decode (struct isdnhdlc_vars *hdlc, const unsigned char *src, int slen,int *count,
diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c
index 9522141f4351..030d1625c5c6 100644
--- a/drivers/isdn/hisax/sedlbauer.c
+++ b/drivers/isdn/hisax/sedlbauer.c
@@ -677,7 +677,11 @@ setup_sedlbauer(struct IsdnCard *card)
677 return (0); 677 return (0);
678#endif /* CONFIG_PCI */ 678#endif /* CONFIG_PCI */
679 } 679 }
680
681#ifdef __ISAPNP__
680ready: 682ready:
683#endif
684
681 /* In case of the sedlbauer pcmcia card, this region is in use, 685 /* In case of the sedlbauer pcmcia card, this region is in use,
682 * reserved for us by the card manager. So we do not check it 686 * reserved for us by the card manager. So we do not check it
683 * here, it would fail. 687 * here, it would fail.
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 46ed65334c51..45debde05fbd 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -155,9 +155,8 @@ static int sedlbauer_probe(struct pcmcia_device *link)
155 DEBUG(0, "sedlbauer_attach()\n"); 155 DEBUG(0, "sedlbauer_attach()\n");
156 156
157 /* Allocate space for private device-specific data */ 157 /* Allocate space for private device-specific data */
158 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 158 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
159 if (!local) return -ENOMEM; 159 if (!local) return -ENOMEM;
160 memset(local, 0, sizeof(local_info_t));
161 local->cardnr = -1; 160 local->cardnr = -1;
162 161
163 local->p_dev = link; 162 local->p_dev = link;
diff --git a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c
index 75d0f248e4ee..fa64115cd7c7 100644
--- a/drivers/isdn/hisax/st5481_b.c
+++ b/drivers/isdn/hisax/st5481_b.c
@@ -14,6 +14,7 @@
14#include <linux/usb.h> 14#include <linux/usb.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <linux/bitrev.h>
17#include "st5481.h" 18#include "st5481.h"
18 19
19static inline void B_L1L2(struct st5481_bcs *bcs, int pr, void *arg) 20static inline void B_L1L2(struct st5481_bcs *bcs, int pr, void *arg)
@@ -72,7 +73,7 @@ static void usb_b_out(struct st5481_bcs *bcs,int buf_nr)
72 register unsigned char *dest = urb->transfer_buffer+len; 73 register unsigned char *dest = urb->transfer_buffer+len;
73 register unsigned int count; 74 register unsigned int count;
74 for (count = 0; count < bytes_sent; count++) 75 for (count = 0; count < bytes_sent; count++)
75 *dest++ = isdnhdlc_bit_rev_tab[*src++]; 76 *dest++ = bitrev8(*src++);
76 } 77 }
77 len += bytes_sent; 78 len += bytes_sent;
78 } else { 79 } else {
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
index 1d8c2618366c..b8c4855cc889 100644
--- a/drivers/isdn/hisax/st5481_d.c
+++ b/drivers/isdn/hisax/st5481_d.c
@@ -173,7 +173,7 @@ static void l1m_debug(struct FsmInst *fi, char *fmt, ...)
173 char buf[256]; 173 char buf[256];
174 174
175 va_start(args, fmt); 175 va_start(args, fmt);
176 vsprintf(buf, fmt, args); 176 vsnprintf(buf, sizeof(buf), fmt, args);
177 DBG(8, "%s", buf); 177 DBG(8, "%s", buf);
178 va_end(args); 178 va_end(args);
179} 179}
@@ -275,7 +275,7 @@ static void dout_debug(struct FsmInst *fi, char *fmt, ...)
275 char buf[256]; 275 char buf[256];
276 276
277 va_start(args, fmt); 277 va_start(args, fmt);
278 vsprintf(buf, fmt, args); 278 vsnprintf(buf, sizeof(buf), fmt, args);
279 DBG(0x2, "%s", buf); 279 DBG(0x2, "%s", buf);
280 va_end(args); 280 va_end(args);
281} 281}
diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c
index 2716aa5c60f7..bb3a28a53ff4 100644
--- a/drivers/isdn/hisax/st5481_init.c
+++ b/drivers/isdn/hisax/st5481_init.c
@@ -69,12 +69,10 @@ static int probe_st5481(struct usb_interface *intf,
69 le16_to_cpu(dev->descriptor.idProduct), 69 le16_to_cpu(dev->descriptor.idProduct),
70 number_of_leds); 70 number_of_leds);
71 71
72 adapter = kmalloc(sizeof(struct st5481_adapter), GFP_KERNEL); 72 adapter = kzalloc(sizeof(struct st5481_adapter), GFP_KERNEL);
73 if (!adapter) 73 if (!adapter)
74 return -ENOMEM; 74 return -ENOMEM;
75 75
76 memset(adapter, 0, sizeof(struct st5481_adapter));
77
78 adapter->number_of_leds = number_of_leds; 76 adapter->number_of_leds = number_of_leds;
79 adapter->usb_dev = dev; 77 adapter->usb_dev = dev;
80 78
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 6b754f183796..3e3e18239ec7 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -137,9 +137,8 @@ static int teles_probe(struct pcmcia_device *link)
137 DEBUG(0, "teles_attach()\n"); 137 DEBUG(0, "teles_attach()\n");
138 138
139 /* Allocate space for private device-specific data */ 139 /* Allocate space for private device-specific data */
140 local = kmalloc(sizeof(local_info_t), GFP_KERNEL); 140 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
141 if (!local) return -ENOMEM; 141 if (!local) return -ENOMEM;
142 memset(local, 0, sizeof(local_info_t));
143 local->cardnr = -1; 142 local->cardnr = -1;
144 143
145 local->p_dev = link; 144 local->p_dev = link;
diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c
index 6bac43cc91bd..b2ae4ec1e49e 100644
--- a/drivers/isdn/hysdn/hycapi.c
+++ b/drivers/isdn/hysdn/hycapi.c
@@ -745,12 +745,11 @@ hycapi_capi_create(hysdn_card *card)
745 return 1; 745 return 1;
746 } 746 }
747 if (!card->hyctrlinfo) { 747 if (!card->hyctrlinfo) {
748 cinfo = (hycapictrl_info *) kmalloc(sizeof(hycapictrl_info), GFP_ATOMIC); 748 cinfo = kzalloc(sizeof(hycapictrl_info), GFP_ATOMIC);
749 if (!cinfo) { 749 if (!cinfo) {
750 printk(KERN_WARNING "HYSDN: no memory for capi-ctrl.\n"); 750 printk(KERN_WARNING "HYSDN: no memory for capi-ctrl.\n");
751 return -ENOMEM; 751 return -ENOMEM;
752 } 752 }
753 memset(cinfo, 0, sizeof(hycapictrl_info));
754 card->hyctrlinfo = cinfo; 753 card->hyctrlinfo = cinfo;
755 cinfo->card = card; 754 cinfo->card = card;
756 spin_lock_init(&cinfo->lock); 755 spin_lock_init(&cinfo->lock);
diff --git a/drivers/isdn/hysdn/hysdn_boot.c b/drivers/isdn/hysdn/hysdn_boot.c
index 6d0eb0f42fca..be787e16bb79 100644
--- a/drivers/isdn/hysdn/hysdn_boot.c
+++ b/drivers/isdn/hysdn/hysdn_boot.c
@@ -278,14 +278,13 @@ pof_write_open(hysdn_card * card, unsigned char **bufp)
278 return (-ERR_ALREADY_BOOT); /* boot already active */ 278 return (-ERR_ALREADY_BOOT); /* boot already active */
279 } 279 }
280 /* error no mem available */ 280 /* error no mem available */
281 if (!(boot = kmalloc(sizeof(struct boot_data), GFP_KERNEL))) { 281 if (!(boot = kzalloc(sizeof(struct boot_data), GFP_KERNEL))) {
282 if (card->debug_flags & LOG_MEM_ERR) 282 if (card->debug_flags & LOG_MEM_ERR)
283 hysdn_addlog(card, "POF open: unable to allocate mem"); 283 hysdn_addlog(card, "POF open: unable to allocate mem");
284 return (-EFAULT); 284 return (-EFAULT);
285 } 285 }
286 card->boot = boot; 286 card->boot = boot;
287 card->state = CARD_STATE_BOOTING; 287 card->state = CARD_STATE_BOOTING;
288 memset(boot, 0, sizeof(struct boot_data));
289 288
290 card->stopcard(card); /* first stop the card */ 289 card->stopcard(card); /* first stop the card */
291 if (card->testram(card)) { 290 if (card->testram(card)) {
diff --git a/drivers/isdn/hysdn/hysdn_init.c b/drivers/isdn/hysdn/hysdn_init.c
index b702ed27252b..9e01748a176e 100644
--- a/drivers/isdn/hysdn/hysdn_init.c
+++ b/drivers/isdn/hysdn/hysdn_init.c
@@ -81,11 +81,10 @@ search_cards(void)
81 if (pci_enable_device(akt_pcidev)) 81 if (pci_enable_device(akt_pcidev))
82 continue; 82 continue;
83 83
84 if (!(card = kmalloc(sizeof(hysdn_card), GFP_KERNEL))) { 84 if (!(card = kzalloc(sizeof(hysdn_card), GFP_KERNEL))) {
85 printk(KERN_ERR "HYSDN: unable to alloc device mem \n"); 85 printk(KERN_ERR "HYSDN: unable to alloc device mem \n");
86 return; 86 return;
87 } 87 }
88 memset(card, 0, sizeof(hysdn_card));
89 card->myid = cardmax; /* set own id */ 88 card->myid = cardmax; /* set own id */
90 card->bus = akt_pcidev->bus->number; 89 card->bus = akt_pcidev->bus->number;
91 card->devfn = akt_pcidev->devfn; /* slot + function */ 90 card->devfn = akt_pcidev->devfn; /* slot + function */
diff --git a/drivers/isdn/hysdn/hysdn_net.c b/drivers/isdn/hysdn/hysdn_net.c
index d205249a1242..557d96c78a62 100644
--- a/drivers/isdn/hysdn/hysdn_net.c
+++ b/drivers/isdn/hysdn/hysdn_net.c
@@ -278,11 +278,10 @@ hysdn_net_create(hysdn_card * card)
278 return (-ENOMEM); 278 return (-ENOMEM);
279 } 279 }
280 hysdn_net_release(card); /* release an existing net device */ 280 hysdn_net_release(card); /* release an existing net device */
281 if ((dev = kmalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) { 281 if ((dev = kzalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) {
282 printk(KERN_WARNING "HYSDN: unable to allocate mem\n"); 282 printk(KERN_WARNING "HYSDN: unable to allocate mem\n");
283 return (-ENOMEM); 283 return (-ENOMEM);
284 } 284 }
285 memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
286 285
287 spin_lock_init(&((struct net_local *) dev)->lock); 286 spin_lock_init(&((struct net_local *) dev)->lock);
288 287
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index fcd49920b220..f241f5e551cb 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -204,7 +204,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t * off)
204{ 204{
205 struct log_data *inf; 205 struct log_data *inf;
206 int len; 206 int len;
207 struct proc_dir_entry *pde = PDE(file->f_dentry->d_inode); 207 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
208 struct procdata *pd = NULL; 208 struct procdata *pd = NULL;
209 hysdn_card *card; 209 hysdn_card *card;
210 210
@@ -354,7 +354,7 @@ static unsigned int
354hysdn_log_poll(struct file *file, poll_table * wait) 354hysdn_log_poll(struct file *file, poll_table * wait)
355{ 355{
356 unsigned int mask = 0; 356 unsigned int mask = 0;
357 struct proc_dir_entry *pde = PDE(file->f_dentry->d_inode); 357 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
358 hysdn_card *card; 358 hysdn_card *card;
359 struct procdata *pd = NULL; 359 struct procdata *pd = NULL;
360 360
@@ -405,8 +405,7 @@ hysdn_proclog_init(hysdn_card * card)
405 405
406 /* create a cardlog proc entry */ 406 /* create a cardlog proc entry */
407 407
408 if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) { 408 if ((pd = kzalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) {
409 memset(pd, 0, sizeof(struct procdata));
410 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid); 409 sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid);
411 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { 410 if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) {
412 pd->log->proc_fops = &log_fops; 411 pd->log->proc_fops = &log_fops;
diff --git a/drivers/isdn/i4l/isdn_bsdcomp.c b/drivers/isdn/i4l/isdn_bsdcomp.c
index 0afe442db3b0..a20f33b4a220 100644
--- a/drivers/isdn/i4l/isdn_bsdcomp.c
+++ b/drivers/isdn/i4l/isdn_bsdcomp.c
@@ -331,12 +331,10 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
331 * Allocate the main control structure for this instance. 331 * Allocate the main control structure for this instance.
332 */ 332 */
333 maxmaxcode = MAXCODE(bits); 333 maxmaxcode = MAXCODE(bits);
334 db = (struct bsd_db *) kmalloc (sizeof (struct bsd_db),GFP_KERNEL); 334 db = kzalloc (sizeof (struct bsd_db),GFP_KERNEL);
335 if (!db) 335 if (!db)
336 return NULL; 336 return NULL;
337 337
338 memset (db, 0, sizeof(struct bsd_db));
339
340 db->xmit = data->flags & IPPP_COMP_FLAG_XMIT; 338 db->xmit = data->flags & IPPP_COMP_FLAG_XMIT;
341 decomp = db->xmit ? 0 : 1; 339 decomp = db->xmit ? 0 : 1;
342 340
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 69aee2602aa6..6a2ef0a87ed9 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1059,7 +1059,7 @@ isdn_info_update(void)
1059static ssize_t 1059static ssize_t
1060isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) 1060isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
1061{ 1061{
1062 uint minor = iminor(file->f_dentry->d_inode); 1062 uint minor = iminor(file->f_path.dentry->d_inode);
1063 int len = 0; 1063 int len = 0;
1064 int drvidx; 1064 int drvidx;
1065 int chidx; 1065 int chidx;
@@ -1166,7 +1166,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
1166static ssize_t 1166static ssize_t
1167isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off) 1167isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
1168{ 1168{
1169 uint minor = iminor(file->f_dentry->d_inode); 1169 uint minor = iminor(file->f_path.dentry->d_inode);
1170 int drvidx; 1170 int drvidx;
1171 int chidx; 1171 int chidx;
1172 int retval; 1172 int retval;
@@ -1228,7 +1228,7 @@ static unsigned int
1228isdn_poll(struct file *file, poll_table * wait) 1228isdn_poll(struct file *file, poll_table * wait)
1229{ 1229{
1230 unsigned int mask = 0; 1230 unsigned int mask = 0;
1231 unsigned int minor = iminor(file->f_dentry->d_inode); 1231 unsigned int minor = iminor(file->f_path.dentry->d_inode);
1232 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); 1232 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
1233 1233
1234 lock_kernel(); 1234 lock_kernel();
@@ -2072,21 +2072,19 @@ isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding)
2072 2072
2073 if ((adding) && (d->rcverr)) 2073 if ((adding) && (d->rcverr))
2074 kfree(d->rcverr); 2074 kfree(d->rcverr);
2075 if (!(d->rcverr = kmalloc(sizeof(int) * m, GFP_ATOMIC))) { 2075 if (!(d->rcverr = kzalloc(sizeof(int) * m, GFP_ATOMIC))) {
2076 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n"); 2076 printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n");
2077 return -1; 2077 return -1;
2078 } 2078 }
2079 memset((char *) d->rcverr, 0, sizeof(int) * m);
2080 2079
2081 if ((adding) && (d->rcvcount)) 2080 if ((adding) && (d->rcvcount))
2082 kfree(d->rcvcount); 2081 kfree(d->rcvcount);
2083 if (!(d->rcvcount = kmalloc(sizeof(int) * m, GFP_ATOMIC))) { 2082 if (!(d->rcvcount = kzalloc(sizeof(int) * m, GFP_ATOMIC))) {
2084 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n"); 2083 printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n");
2085 if (!adding) 2084 if (!adding)
2086 kfree(d->rcverr); 2085 kfree(d->rcverr);
2087 return -1; 2086 return -1;
2088 } 2087 }
2089 memset((char *) d->rcvcount, 0, sizeof(int) * m);
2090 2088
2091 if ((adding) && (d->rpqueue)) { 2089 if ((adding) && (d->rpqueue)) {
2092 for (j = 0; j < d->channels; j++) 2090 for (j = 0; j < d->channels; j++)
@@ -2226,11 +2224,10 @@ register_isdn(isdn_if * i)
2226 printk(KERN_WARNING "register_isdn: No write routine given.\n"); 2224 printk(KERN_WARNING "register_isdn: No write routine given.\n");
2227 return 0; 2225 return 0;
2228 } 2226 }
2229 if (!(d = kmalloc(sizeof(isdn_driver_t), GFP_KERNEL))) { 2227 if (!(d = kzalloc(sizeof(isdn_driver_t), GFP_KERNEL))) {
2230 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n"); 2228 printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n");
2231 return 0; 2229 return 0;
2232 } 2230 }
2233 memset((char *) d, 0, sizeof(isdn_driver_t));
2234 2231
2235 d->maxbufsize = i->maxbufsize; 2232 d->maxbufsize = i->maxbufsize;
2236 d->pktcount = 0; 2233 d->pktcount = 0;
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 2e4daebfb7e0..c36c817578cb 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -2542,17 +2542,15 @@ isdn_net_new(char *name, struct net_device *master)
2542 printk(KERN_WARNING "isdn_net: interface %s already exists\n", name); 2542 printk(KERN_WARNING "isdn_net: interface %s already exists\n", name);
2543 return NULL; 2543 return NULL;
2544 } 2544 }
2545 if (!(netdev = (isdn_net_dev *) kmalloc(sizeof(isdn_net_dev), GFP_KERNEL))) { 2545 if (!(netdev = kzalloc(sizeof(isdn_net_dev), GFP_KERNEL))) {
2546 printk(KERN_WARNING "isdn_net: Could not allocate net-device\n"); 2546 printk(KERN_WARNING "isdn_net: Could not allocate net-device\n");
2547 return NULL; 2547 return NULL;
2548 } 2548 }
2549 memset(netdev, 0, sizeof(isdn_net_dev)); 2549 if (!(netdev->local = kzalloc(sizeof(isdn_net_local), GFP_KERNEL))) {
2550 if (!(netdev->local = (isdn_net_local *) kmalloc(sizeof(isdn_net_local), GFP_KERNEL))) {
2551 printk(KERN_WARNING "isdn_net: Could not allocate device locals\n"); 2550 printk(KERN_WARNING "isdn_net: Could not allocate device locals\n");
2552 kfree(netdev); 2551 kfree(netdev);
2553 return NULL; 2552 return NULL;
2554 } 2553 }
2555 memset(netdev->local, 0, sizeof(isdn_net_local));
2556 if (name == NULL) 2554 if (name == NULL)
2557 strcpy(netdev->local->name, " "); 2555 strcpy(netdev->local->name, " ");
2558 else 2556 else
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 119412d6bd15..43811795b46b 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -667,7 +667,7 @@ isdn_ppp_poll(struct file *file, poll_table * wait)
667 667
668 if (is->debug & 0x2) 668 if (is->debug & 0x2)
669 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n", 669 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n",
670 iminor(file->f_dentry->d_inode)); 670 iminor(file->f_path.dentry->d_inode));
671 671
672 /* just registers wait_queue hook. This doesn't really wait. */ 672 /* just registers wait_queue hook. This doesn't really wait. */
673 poll_wait(file, &is->wq, wait); 673 poll_wait(file, &is->wq, wait);
@@ -876,14 +876,12 @@ isdn_ppp_init(void)
876#endif /* CONFIG_ISDN_MPP */ 876#endif /* CONFIG_ISDN_MPP */
877 877
878 for (i = 0; i < ISDN_MAX_CHANNELS; i++) { 878 for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
879 if (!(ippp_table[i] = (struct ippp_struct *) 879 if (!(ippp_table[i] = kzalloc(sizeof(struct ippp_struct), GFP_KERNEL))) {
880 kmalloc(sizeof(struct ippp_struct), GFP_KERNEL))) {
881 printk(KERN_WARNING "isdn_ppp_init: Could not alloc ippp_table\n"); 880 printk(KERN_WARNING "isdn_ppp_init: Could not alloc ippp_table\n");
882 for (j = 0; j < i; j++) 881 for (j = 0; j < i; j++)
883 kfree(ippp_table[j]); 882 kfree(ippp_table[j]);
884 return -1; 883 return -1;
885 } 884 }
886 memset((char *) ippp_table[i], 0, sizeof(struct ippp_struct));
887 spin_lock_init(&ippp_table[i]->buflock); 885 spin_lock_init(&ippp_table[i]->buflock);
888 ippp_table[i]->state = 0; 886 ippp_table[i]->state = 0;
889 ippp_table[i]->first = ippp_table[i]->rq + NUM_RCV_BUFFS - 1; 887 ippp_table[i]->first = ippp_table[i]->rq + NUM_RCV_BUFFS - 1;
@@ -1529,10 +1527,8 @@ static int isdn_ppp_mp_bundle_array_init(void)
1529{ 1527{
1530 int i; 1528 int i;
1531 int sz = ISDN_MAX_CHANNELS*sizeof(ippp_bundle); 1529 int sz = ISDN_MAX_CHANNELS*sizeof(ippp_bundle);
1532 if( (isdn_ppp_bundle_arr = (ippp_bundle*)kmalloc(sz, 1530 if( (isdn_ppp_bundle_arr = kzalloc(sz, GFP_KERNEL)) == NULL )
1533 GFP_KERNEL)) == NULL )
1534 return -ENOMEM; 1531 return -ENOMEM;
1535 memset(isdn_ppp_bundle_arr, 0, sz);
1536 for( i = 0; i < ISDN_MAX_CHANNELS; i++ ) 1532 for( i = 0; i < ISDN_MAX_CHANNELS; i++ )
1537 spin_lock_init(&isdn_ppp_bundle_arr[i].lock); 1533 spin_lock_init(&isdn_ppp_bundle_arr[i].lock);
1538 return 0; 1534 return 0;
@@ -2246,13 +2242,12 @@ static void isdn_ppp_ccp_xmit_reset(struct ippp_struct *is, int proto,
2246static struct ippp_ccp_reset *isdn_ppp_ccp_reset_alloc(struct ippp_struct *is) 2242static struct ippp_ccp_reset *isdn_ppp_ccp_reset_alloc(struct ippp_struct *is)
2247{ 2243{
2248 struct ippp_ccp_reset *r; 2244 struct ippp_ccp_reset *r;
2249 r = kmalloc(sizeof(struct ippp_ccp_reset), GFP_KERNEL); 2245 r = kzalloc(sizeof(struct ippp_ccp_reset), GFP_KERNEL);
2250 if(!r) { 2246 if(!r) {
2251 printk(KERN_ERR "ippp_ccp: failed to allocate reset data" 2247 printk(KERN_ERR "ippp_ccp: failed to allocate reset data"
2252 " structure - no mem\n"); 2248 " structure - no mem\n");
2253 return NULL; 2249 return NULL;
2254 } 2250 }
2255 memset(r, 0, sizeof(struct ippp_ccp_reset));
2256 printk(KERN_DEBUG "ippp_ccp: allocated reset data structure %p\n", r); 2251 printk(KERN_DEBUG "ippp_ccp: allocated reset data structure %p\n", r);
2257 is->reset = r; 2252 is->reset = r;
2258 return r; 2253 return r;
@@ -2338,10 +2333,9 @@ static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_s
2338 id); 2333 id);
2339 return NULL; 2334 return NULL;
2340 } else { 2335 } else {
2341 rs = kmalloc(sizeof(struct ippp_ccp_reset_state), GFP_KERNEL); 2336 rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_KERNEL);
2342 if(!rs) 2337 if(!rs)
2343 return NULL; 2338 return NULL;
2344 memset(rs, 0, sizeof(struct ippp_ccp_reset_state));
2345 rs->state = CCPResetIdle; 2339 rs->state = CCPResetIdle;
2346 rs->is = is; 2340 rs->is = is;
2347 rs->id = id; 2341 rs->id = id;
@@ -2536,6 +2530,11 @@ static struct sk_buff *isdn_ppp_decompress(struct sk_buff *skb,struct ippp_struc
2536 rsparm.maxdlen = IPPP_RESET_MAXDATABYTES; 2530 rsparm.maxdlen = IPPP_RESET_MAXDATABYTES;
2537 2531
2538 skb_out = dev_alloc_skb(is->mru + PPP_HDRLEN); 2532 skb_out = dev_alloc_skb(is->mru + PPP_HDRLEN);
2533 if (!skb_out) {
2534 kfree_skb(skb);
2535 printk(KERN_ERR "ippp: decomp memory allocation failure\n");
2536 return NULL;
2537 }
2539 len = ipc->decompress(stat, skb, skb_out, &rsparm); 2538 len = ipc->decompress(stat, skb, skb_out, &rsparm);
2540 kfree_skb(skb); 2539 kfree_skb(skb);
2541 if (len <= 0) { 2540 if (len <= 0) {
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 2b91bb07fc7f..fc80afe555b9 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1464,7 +1464,7 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
1464} 1464}
1465 1465
1466static void 1466static void
1467isdn_tty_set_termios(struct tty_struct *tty, struct termios *old_termios) 1467isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
1468{ 1468{
1469 modem_info *info = (modem_info *) tty->driver_data; 1469 modem_info *info = (modem_info *) tty->driver_data;
1470 1470
diff --git a/drivers/isdn/i4l/isdn_v110.c b/drivers/isdn/i4l/isdn_v110.c
index 38619e8cd823..5484d3c38a57 100644
--- a/drivers/isdn/i4l/isdn_v110.c
+++ b/drivers/isdn/i4l/isdn_v110.c
@@ -92,9 +92,8 @@ isdn_v110_open(unsigned char key, int hdrlen, int maxsize)
92 int i; 92 int i;
93 isdn_v110_stream *v; 93 isdn_v110_stream *v;
94 94
95 if ((v = kmalloc(sizeof(isdn_v110_stream), GFP_ATOMIC)) == NULL) 95 if ((v = kzalloc(sizeof(isdn_v110_stream), GFP_ATOMIC)) == NULL)
96 return NULL; 96 return NULL;
97 memset(v, 0, sizeof(isdn_v110_stream));
98 v->key = key; 97 v->key = key;
99 v->nbits = 0; 98 v->nbits = 0;
100 for (i = 0; key & (1 << i); i++) 99 for (i = 0; key & (1 << i); i++)
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index 730bbd07ebc7..1e699bcaba0f 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -1519,12 +1519,11 @@ icn_initcard(int port, char *id)
1519 icn_card *card; 1519 icn_card *card;
1520 int i; 1520 int i;
1521 1521
1522 if (!(card = (icn_card *) kmalloc(sizeof(icn_card), GFP_KERNEL))) { 1522 if (!(card = kzalloc(sizeof(icn_card), GFP_KERNEL))) {
1523 printk(KERN_WARNING 1523 printk(KERN_WARNING
1524 "icn: (%s) Could not allocate card-struct.\n", id); 1524 "icn: (%s) Could not allocate card-struct.\n", id);
1525 return (icn_card *) 0; 1525 return (icn_card *) 0;
1526 } 1526 }
1527 memset((char *) card, 0, sizeof(icn_card));
1528 spin_lock_init(&card->lock); 1527 spin_lock_init(&card->lock);
1529 card->port = port; 1528 card->port = port;
1530 card->interface.owner = THIS_MODULE; 1529 card->interface.owner = THIS_MODULE;
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index c3ae2edaf6fa..e3add27dd0e1 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -1430,12 +1430,11 @@ isdnloop_initcard(char *id)
1430 isdnloop_card *card; 1430 isdnloop_card *card;
1431 int i; 1431 int i;
1432 1432
1433 if (!(card = (isdnloop_card *) kmalloc(sizeof(isdnloop_card), GFP_KERNEL))) { 1433 if (!(card = kzalloc(sizeof(isdnloop_card), GFP_KERNEL))) {
1434 printk(KERN_WARNING 1434 printk(KERN_WARNING
1435 "isdnloop: (%s) Could not allocate card-struct.\n", id); 1435 "isdnloop: (%s) Could not allocate card-struct.\n", id);
1436 return (isdnloop_card *) 0; 1436 return (isdnloop_card *) 0;
1437 } 1437 }
1438 memset((char *) card, 0, sizeof(isdnloop_card));
1439 card->interface.owner = THIS_MODULE; 1438 card->interface.owner = THIS_MODULE;
1440 card->interface.channels = ISDNLOOP_BCH; 1439 card->interface.channels = ISDNLOOP_BCH;
1441 card->interface.hl_hdrlen = 1; /* scratch area for storing ack flag*/ 1440 card->interface.hl_hdrlen = 1; /* scratch area for storing ack flag*/
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c
index 1966f3410a13..11c1b0b6e390 100644
--- a/drivers/isdn/pcbit/drv.c
+++ b/drivers/isdn/pcbit/drv.c
@@ -73,14 +73,13 @@ int pcbit_init_dev(int board, int mem_base, int irq)
73 struct pcbit_dev *dev; 73 struct pcbit_dev *dev;
74 isdn_if *dev_if; 74 isdn_if *dev_if;
75 75
76 if ((dev=kmalloc(sizeof(struct pcbit_dev), GFP_KERNEL)) == NULL) 76 if ((dev=kzalloc(sizeof(struct pcbit_dev), GFP_KERNEL)) == NULL)
77 { 77 {
78 printk("pcbit_init: couldn't malloc pcbit_dev struct\n"); 78 printk("pcbit_init: couldn't malloc pcbit_dev struct\n");
79 return -ENOMEM; 79 return -ENOMEM;
80 } 80 }
81 81
82 dev_pcbit[board] = dev; 82 dev_pcbit[board] = dev;
83 memset(dev, 0, sizeof(struct pcbit_dev));
84 init_waitqueue_head(&dev->set_running_wq); 83 init_waitqueue_head(&dev->set_running_wq);
85 spin_lock_init(&dev->lock); 84 spin_lock_init(&dev->lock);
86 85
@@ -104,7 +103,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
104 return -EACCES; 103 return -EACCES;
105 } 104 }
106 105
107 dev->b1 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL); 106 dev->b1 = kzalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
108 if (!dev->b1) { 107 if (!dev->b1) {
109 printk("pcbit_init: couldn't malloc pcbit_chan struct\n"); 108 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
110 iounmap(dev->sh_mem); 109 iounmap(dev->sh_mem);
@@ -113,7 +112,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
113 return -ENOMEM; 112 return -ENOMEM;
114 } 113 }
115 114
116 dev->b2 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL); 115 dev->b2 = kzalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
117 if (!dev->b2) { 116 if (!dev->b2) {
118 printk("pcbit_init: couldn't malloc pcbit_chan struct\n"); 117 printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
119 kfree(dev->b1); 118 kfree(dev->b1);
@@ -123,8 +122,6 @@ int pcbit_init_dev(int board, int mem_base, int irq)
123 return -ENOMEM; 122 return -ENOMEM;
124 } 123 }
125 124
126 memset(dev->b1, 0, sizeof(struct pcbit_chan));
127 memset(dev->b2, 0, sizeof(struct pcbit_chan));
128 dev->b2->id = 1; 125 dev->b2->id = 1;
129 126
130 INIT_WORK(&dev->qdelivery, pcbit_deliver); 127 INIT_WORK(&dev->qdelivery, pcbit_deliver);
diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c
index 0c9f6df873fc..6ff85574e941 100644
--- a/drivers/isdn/pcbit/layer2.c
+++ b/drivers/isdn/pcbit/layer2.c
@@ -369,13 +369,12 @@ pcbit_receive(struct pcbit_dev *dev)
369 kfree(dev->read_frame); 369 kfree(dev->read_frame);
370 dev->read_frame = NULL; 370 dev->read_frame = NULL;
371 } 371 }
372 frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC); 372 frame = kzalloc(sizeof(struct frame_buf), GFP_ATOMIC);
373 373
374 if (frame == NULL) { 374 if (frame == NULL) {
375 printk(KERN_WARNING "kmalloc failed\n"); 375 printk(KERN_WARNING "kmalloc failed\n");
376 return; 376 return;
377 } 377 }
378 memset(frame, 0, sizeof(struct frame_buf));
379 378
380 cpu = pcbit_readb(dev); 379 cpu = pcbit_readb(dev);
381 proc = pcbit_readb(dev); 380 proc = pcbit_readb(dev);
diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
index 06c9872e8c6a..150759a5cddf 100644
--- a/drivers/isdn/sc/init.c
+++ b/drivers/isdn/sc/init.c
@@ -271,14 +271,13 @@ static int __init sc_init(void)
271 * Horray! We found a board, Make sure we can register 271 * Horray! We found a board, Make sure we can register
272 * it with ISDN4Linux 272 * it with ISDN4Linux
273 */ 273 */
274 interface = kmalloc(sizeof(isdn_if), GFP_KERNEL); 274 interface = kzalloc(sizeof(isdn_if), GFP_KERNEL);
275 if (interface == NULL) { 275 if (interface == NULL) {
276 /* 276 /*
277 * Oops, can't malloc isdn_if 277 * Oops, can't malloc isdn_if
278 */ 278 */
279 continue; 279 continue;
280 } 280 }
281 memset(interface, 0, sizeof(isdn_if));
282 281
283 interface->owner = THIS_MODULE; 282 interface->owner = THIS_MODULE;
284 interface->hl_hdrlen = 0; 283 interface->hl_hdrlen = 0;
@@ -294,7 +293,7 @@ static int __init sc_init(void)
294 /* 293 /*
295 * Allocate the board structure 294 * Allocate the board structure
296 */ 295 */
297 sc_adapter[cinst] = kmalloc(sizeof(board), GFP_KERNEL); 296 sc_adapter[cinst] = kzalloc(sizeof(board), GFP_KERNEL);
298 if (sc_adapter[cinst] == NULL) { 297 if (sc_adapter[cinst] == NULL) {
299 /* 298 /*
300 * Oops, can't alloc memory for the board 299 * Oops, can't alloc memory for the board
@@ -302,7 +301,6 @@ static int __init sc_init(void)
302 kfree(interface); 301 kfree(interface);
303 continue; 302 continue;
304 } 303 }
305 memset(sc_adapter[cinst], 0, sizeof(board));
306 spin_lock_init(&sc_adapter[cinst]->lock); 304 spin_lock_init(&sc_adapter[cinst]->lock);
307 305
308 if(!register_isdn(interface)) { 306 if(!register_isdn(interface)) {
@@ -326,7 +324,7 @@ static int __init sc_init(void)
326 /* 324 /*
327 * Allocate channels status structures 325 * Allocate channels status structures
328 */ 326 */
329 sc_adapter[cinst]->channel = kmalloc(sizeof(bchan) * channels, GFP_KERNEL); 327 sc_adapter[cinst]->channel = kzalloc(sizeof(bchan) * channels, GFP_KERNEL);
330 if (sc_adapter[cinst]->channel == NULL) { 328 if (sc_adapter[cinst]->channel == NULL) {
331 /* 329 /*
332 * Oops, can't alloc memory for the channels 330 * Oops, can't alloc memory for the channels
@@ -336,7 +334,6 @@ static int __init sc_init(void)
336 kfree(sc_adapter[cinst]); 334 kfree(sc_adapter[cinst]);
337 continue; 335 continue;
338 } 336 }
339 memset(sc_adapter[cinst]->channel, 0, sizeof(bchan) * channels);
340 337
341 /* 338 /*
342 * Lock down the hardware resources 339 * Lock down the hardware resources