diff options
author | Helge Deller <deller@parisc-linux.org> | 2006-01-17 14:40:40 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@duet.int.mcmartin.ca> | 2006-01-22 20:26:31 -0500 |
commit | cb6fc18e9ca615f03d18e60c49855b434ca2e51e (patch) | |
tree | c35af13054f8eeb7a24c928edf55fdc69c912562 /drivers | |
parent | a1c744439591b1d4350f0926615d501e7cfbb708 (diff) |
[PARISC] Use kzalloc and other janitor-style cleanups
Helge,
o Convert a bunch of kmalloc/memset uses to kzalloc.
o pci.c: Add some __read_mostly annotations.
o pci.c: Move constant pci_post_reset_delay to asm/pci.h
o grfioctl.h: Add A4450A to comment of CRT_ID_VISUALIZE_EG.
o Add some consts to perf.c/perf_images.h
Matthew,
o sticore.c: Add some consts to suppress compile warnings.
Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/parisc/ccio-dma.c | 7 | ||||
-rw-r--r-- | drivers/parisc/dino.c | 4 | ||||
-rw-r--r-- | drivers/parisc/hppb.c | 3 | ||||
-rw-r--r-- | drivers/parisc/iosapic.c | 8 | ||||
-rw-r--r-- | drivers/parisc/lasi.c | 2 | ||||
-rw-r--r-- | drivers/parisc/lba_pci.c | 6 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 3 | ||||
-rw-r--r-- | drivers/parisc/wax.c | 2 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.c | 2 | ||||
-rw-r--r-- | drivers/video/console/sticore.c | 45 |
10 files changed, 32 insertions, 50 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 9e0229f7e25f..f46e8438e0d2 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
@@ -1423,7 +1423,7 @@ static void __init ccio_init_resources(struct ioc *ioc) | |||
1423 | struct resource *res = ioc->mmio_region; | 1423 | struct resource *res = ioc->mmio_region; |
1424 | char *name = kmalloc(14, GFP_KERNEL); | 1424 | char *name = kmalloc(14, GFP_KERNEL); |
1425 | 1425 | ||
1426 | sprintf(name, "GSC Bus [%d/]", ioc->hw_path); | 1426 | snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path); |
1427 | 1427 | ||
1428 | ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low); | 1428 | ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low); |
1429 | ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv); | 1429 | ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv); |
@@ -1557,12 +1557,11 @@ static int ccio_probe(struct parisc_device *dev) | |||
1557 | int i; | 1557 | int i; |
1558 | struct ioc *ioc, **ioc_p = &ioc_list; | 1558 | struct ioc *ioc, **ioc_p = &ioc_list; |
1559 | 1559 | ||
1560 | ioc = kmalloc(sizeof(struct ioc), GFP_KERNEL); | 1560 | ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); |
1561 | if (ioc == NULL) { | 1561 | if (ioc == NULL) { |
1562 | printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); | 1562 | printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); |
1563 | return 1; | 1563 | return 1; |
1564 | } | 1564 | } |
1565 | memset(ioc, 0, sizeof(struct ioc)); | ||
1566 | 1565 | ||
1567 | ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn"; | 1566 | ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn"; |
1568 | 1567 | ||
@@ -1578,7 +1577,7 @@ static int ccio_probe(struct parisc_device *dev) | |||
1578 | ccio_ioc_init(ioc); | 1577 | ccio_ioc_init(ioc); |
1579 | ccio_init_resources(ioc); | 1578 | ccio_init_resources(ioc); |
1580 | hppa_dma_ops = &ccio_ops; | 1579 | hppa_dma_ops = &ccio_ops; |
1581 | dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL); | 1580 | dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL); |
1582 | 1581 | ||
1583 | /* if this fails, no I/O cards will work, so may as well bug */ | 1582 | /* if this fails, no I/O cards will work, so may as well bug */ |
1584 | BUG_ON(dev->dev.platform_data == NULL); | 1583 | BUG_ON(dev->dev.platform_data == NULL); |
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 216d1d859326..3d1a7f98c676 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c | |||
@@ -989,14 +989,12 @@ static int __init dino_probe(struct parisc_device *dev) | |||
989 | */ | 989 | */ |
990 | } | 990 | } |
991 | 991 | ||
992 | dino_dev = kmalloc(sizeof(struct dino_device), GFP_KERNEL); | 992 | dino_dev = kzalloc(sizeof(struct dino_device), GFP_KERNEL); |
993 | if (!dino_dev) { | 993 | if (!dino_dev) { |
994 | printk("dino_init_chip - couldn't alloc dino_device\n"); | 994 | printk("dino_init_chip - couldn't alloc dino_device\n"); |
995 | return 1; | 995 | return 1; |
996 | } | 996 | } |
997 | 997 | ||
998 | memset(dino_dev, 0, sizeof(struct dino_device)); | ||
999 | |||
1000 | dino_dev->hba.dev = dev; | 998 | dino_dev->hba.dev = dev; |
1001 | dino_dev->hba.base_addr = ioremap(hpa, 4096); | 999 | dino_dev->hba.base_addr = ioremap(hpa, 4096); |
1002 | dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ | 1000 | dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ |
diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c index 5edf93f80757..07dc2b6d4e93 100644 --- a/drivers/parisc/hppb.c +++ b/drivers/parisc/hppb.c | |||
@@ -60,12 +60,11 @@ static int hppb_probe(struct parisc_device *dev) | |||
60 | } | 60 | } |
61 | 61 | ||
62 | if(card->hpa) { | 62 | if(card->hpa) { |
63 | card->next = kmalloc(sizeof(struct hppb_card), GFP_KERNEL); | 63 | card->next = kzalloc(sizeof(struct hppb_card), GFP_KERNEL); |
64 | if(!card->next) { | 64 | if(!card->next) { |
65 | printk(KERN_ERR "HP-PB: Unable to allocate memory.\n"); | 65 | printk(KERN_ERR "HP-PB: Unable to allocate memory.\n"); |
66 | return 1; | 66 | return 1; |
67 | } | 67 | } |
68 | memset(card->next, '\0', sizeof(struct hppb_card)); | ||
69 | card = card->next; | 68 | card = card->next; |
70 | } | 69 | } |
71 | printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa.start); | 70 | printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa.start); |
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 19657efa8dc3..8d7a36392eb8 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c | |||
@@ -873,28 +873,24 @@ void *iosapic_register(unsigned long hpa) | |||
873 | return NULL; | 873 | return NULL; |
874 | } | 874 | } |
875 | 875 | ||
876 | isi = (struct iosapic_info *)kmalloc(sizeof(struct iosapic_info), GFP_KERNEL); | 876 | isi = (struct iosapic_info *)kzalloc(sizeof(struct iosapic_info), GFP_KERNEL); |
877 | if (!isi) { | 877 | if (!isi) { |
878 | BUG(); | 878 | BUG(); |
879 | return NULL; | 879 | return NULL; |
880 | } | 880 | } |
881 | 881 | ||
882 | memset(isi, 0, sizeof(struct iosapic_info)); | ||
883 | |||
884 | isi->addr = ioremap(hpa, 4096); | 882 | isi->addr = ioremap(hpa, 4096); |
885 | isi->isi_hpa = hpa; | 883 | isi->isi_hpa = hpa; |
886 | isi->isi_version = iosapic_rd_version(isi); | 884 | isi->isi_version = iosapic_rd_version(isi); |
887 | isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; | 885 | isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1; |
888 | 886 | ||
889 | vip = isi->isi_vector = (struct vector_info *) | 887 | vip = isi->isi_vector = (struct vector_info *) |
890 | kmalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL); | 888 | kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL); |
891 | if (vip == NULL) { | 889 | if (vip == NULL) { |
892 | kfree(isi); | 890 | kfree(isi); |
893 | return NULL; | 891 | return NULL; |
894 | } | 892 | } |
895 | 893 | ||
896 | memset(vip, 0, sizeof(struct vector_info) * isi->isi_num_vectors); | ||
897 | |||
898 | for (cnt=0; cnt < isi->isi_num_vectors; cnt++, vip++) { | 894 | for (cnt=0; cnt < isi->isi_num_vectors; cnt++, vip++) { |
899 | vip->irqline = (unsigned char) cnt; | 895 | vip->irqline = (unsigned char) cnt; |
900 | vip->iosapic = isi; | 896 | vip->iosapic = isi; |
diff --git a/drivers/parisc/lasi.c b/drivers/parisc/lasi.c index 2b3ba1dcf332..d043a8a33511 100644 --- a/drivers/parisc/lasi.c +++ b/drivers/parisc/lasi.c | |||
@@ -170,7 +170,7 @@ lasi_init_chip(struct parisc_device *dev) | |||
170 | struct gsc_irq gsc_irq; | 170 | struct gsc_irq gsc_irq; |
171 | int ret; | 171 | int ret; |
172 | 172 | ||
173 | lasi = kmalloc(sizeof(*lasi), GFP_KERNEL); | 173 | lasi = kzalloc(sizeof(*lasi), GFP_KERNEL); |
174 | if (!lasi) | 174 | if (!lasi) |
175 | return -ENOMEM; | 175 | return -ENOMEM; |
176 | 176 | ||
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index cbae8c8963fa..e8a2a4a852f5 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -1565,7 +1565,7 @@ lba_driver_probe(struct parisc_device *dev) | |||
1565 | } else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) { | 1565 | } else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) { |
1566 | func_class &= 0xff; | 1566 | func_class &= 0xff; |
1567 | version = kmalloc(6, GFP_KERNEL); | 1567 | version = kmalloc(6, GFP_KERNEL); |
1568 | sprintf(version,"TR%d.%d",(func_class >> 4),(func_class & 0xf)); | 1568 | snprintf(version, 6, "TR%d.%d",(func_class >> 4),(func_class & 0xf)); |
1569 | /* We could use one printk for both Elroy and Mercury, | 1569 | /* We could use one printk for both Elroy and Mercury, |
1570 | * but for the mask for func_class. | 1570 | * but for the mask for func_class. |
1571 | */ | 1571 | */ |
@@ -1586,14 +1586,12 @@ lba_driver_probe(struct parisc_device *dev) | |||
1586 | ** have an IRT entry will get NULL back from iosapic code. | 1586 | ** have an IRT entry will get NULL back from iosapic code. |
1587 | */ | 1587 | */ |
1588 | 1588 | ||
1589 | lba_dev = kmalloc(sizeof(struct lba_device), GFP_KERNEL); | 1589 | lba_dev = kzalloc(sizeof(struct lba_device), GFP_KERNEL); |
1590 | if (!lba_dev) { | 1590 | if (!lba_dev) { |
1591 | printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n"); | 1591 | printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n"); |
1592 | return(1); | 1592 | return(1); |
1593 | } | 1593 | } |
1594 | 1594 | ||
1595 | memset(lba_dev, 0, sizeof(struct lba_device)); | ||
1596 | |||
1597 | 1595 | ||
1598 | /* ---------- First : initialize data we already have --------- */ | 1596 | /* ---------- First : initialize data we already have --------- */ |
1599 | 1597 | ||
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index c85653f315aa..52f265e97729 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -2064,14 +2064,13 @@ sba_driver_callback(struct parisc_device *dev) | |||
2064 | printk(KERN_INFO "%s found %s at 0x%lx\n", | 2064 | printk(KERN_INFO "%s found %s at 0x%lx\n", |
2065 | MODULE_NAME, version, dev->hpa.start); | 2065 | MODULE_NAME, version, dev->hpa.start); |
2066 | 2066 | ||
2067 | sba_dev = kmalloc(sizeof(struct sba_device), GFP_KERNEL); | 2067 | sba_dev = kzalloc(sizeof(struct sba_device), GFP_KERNEL); |
2068 | if (!sba_dev) { | 2068 | if (!sba_dev) { |
2069 | printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n"); | 2069 | printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n"); |
2070 | return -ENOMEM; | 2070 | return -ENOMEM; |
2071 | } | 2071 | } |
2072 | 2072 | ||
2073 | parisc_set_drvdata(dev, sba_dev); | 2073 | parisc_set_drvdata(dev, sba_dev); |
2074 | memset(sba_dev, 0, sizeof(struct sba_device)); | ||
2075 | 2074 | ||
2076 | for(i=0; i<MAX_IOC; i++) | 2075 | for(i=0; i<MAX_IOC; i++) |
2077 | spin_lock_init(&(sba_dev->ioc[i].res_lock)); | 2076 | spin_lock_init(&(sba_dev->ioc[i].res_lock)); |
diff --git a/drivers/parisc/wax.c b/drivers/parisc/wax.c index 17dce2adf7fe..813c2c24ab1e 100644 --- a/drivers/parisc/wax.c +++ b/drivers/parisc/wax.c | |||
@@ -76,7 +76,7 @@ wax_init_chip(struct parisc_device *dev) | |||
76 | struct gsc_irq gsc_irq; | 76 | struct gsc_irq gsc_irq; |
77 | int ret; | 77 | int ret; |
78 | 78 | ||
79 | wax = kmalloc(sizeof(*wax), GFP_KERNEL); | 79 | wax = kzalloc(sizeof(*wax), GFP_KERNEL); |
80 | if (!wax) | 80 | if (!wax) |
81 | return -ENOMEM; | 81 | return -ENOMEM; |
82 | 82 | ||
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index fde29a75f888..1de52d9febf9 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c | |||
@@ -249,7 +249,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, | |||
249 | struct parport tmp; | 249 | struct parport tmp; |
250 | struct parport *p = &tmp; | 250 | struct parport *p = &tmp; |
251 | 251 | ||
252 | priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); | 252 | priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); |
253 | if (!priv) { | 253 | if (!priv) { |
254 | printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); | 254 | printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); |
255 | return NULL; | 255 | return NULL; |
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index a7bcd17112c0..0339f5640a78 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c | |||
@@ -30,10 +30,11 @@ | |||
30 | 30 | ||
31 | #define STI_DRIVERVERSION "Version 0.9a" | 31 | #define STI_DRIVERVERSION "Version 0.9a" |
32 | 32 | ||
33 | struct sti_struct *default_sti; | 33 | struct sti_struct *default_sti __read_mostly; |
34 | 34 | ||
35 | static int num_sti_roms; /* # of STI ROMS found */ | 35 | /* number of STI ROMS found and their ptrs to each struct */ |
36 | static struct sti_struct *sti_roms[MAX_STI_ROMS]; /* ptr to each sti_struct */ | 36 | static int num_sti_roms __read_mostly; |
37 | static struct sti_struct *sti_roms[MAX_STI_ROMS] __read_mostly; | ||
37 | 38 | ||
38 | 39 | ||
39 | /* The colour indices used by STI are | 40 | /* The colour indices used by STI are |
@@ -266,7 +267,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest) | |||
266 | 267 | ||
267 | 268 | ||
268 | 269 | ||
269 | static char default_sti_path[21]; | 270 | static char default_sti_path[21] __read_mostly; |
270 | 271 | ||
271 | #ifndef MODULE | 272 | #ifndef MODULE |
272 | static int __init sti_setup(char *str) | 273 | static int __init sti_setup(char *str) |
@@ -414,10 +415,10 @@ sti_init_glob_cfg(struct sti_struct *sti, | |||
414 | if (!sti->sti_mem_request) | 415 | if (!sti->sti_mem_request) |
415 | sti->sti_mem_request = 256; /* STI default */ | 416 | sti->sti_mem_request = 256; /* STI default */ |
416 | 417 | ||
417 | glob_cfg = kmalloc(sizeof(*sti->glob_cfg), GFP_KERNEL); | 418 | glob_cfg = kzalloc(sizeof(*sti->glob_cfg), GFP_KERNEL); |
418 | glob_cfg_ext = kmalloc(sizeof(*glob_cfg_ext), GFP_KERNEL); | 419 | glob_cfg_ext = kzalloc(sizeof(*glob_cfg_ext), GFP_KERNEL); |
419 | save_addr = kmalloc(save_addr_size, GFP_KERNEL); | 420 | save_addr = kzalloc(save_addr_size, GFP_KERNEL); |
420 | sti_mem_addr = kmalloc(sti->sti_mem_request, GFP_KERNEL); | 421 | sti_mem_addr = kzalloc(sti->sti_mem_request, GFP_KERNEL); |
421 | 422 | ||
422 | if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) { | 423 | if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) { |
423 | kfree(glob_cfg); | 424 | kfree(glob_cfg); |
@@ -427,11 +428,6 @@ sti_init_glob_cfg(struct sti_struct *sti, | |||
427 | return -ENOMEM; | 428 | return -ENOMEM; |
428 | } | 429 | } |
429 | 430 | ||
430 | memset(glob_cfg, 0, sizeof(*glob_cfg)); | ||
431 | memset(glob_cfg_ext, 0, sizeof(*glob_cfg_ext)); | ||
432 | memset(save_addr, 0, save_addr_size); | ||
433 | memset(sti_mem_addr, 0, sti->sti_mem_request); | ||
434 | |||
435 | glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext); | 431 | glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext); |
436 | glob_cfg->save_addr = STI_PTR(save_addr); | 432 | glob_cfg->save_addr = STI_PTR(save_addr); |
437 | for (i=0; i<8; i++) { | 433 | for (i=0; i<8; i++) { |
@@ -502,9 +498,9 @@ sti_init_glob_cfg(struct sti_struct *sti, | |||
502 | 498 | ||
503 | #ifdef CONFIG_FB | 499 | #ifdef CONFIG_FB |
504 | struct sti_cooked_font * __init | 500 | struct sti_cooked_font * __init |
505 | sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | 501 | sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) |
506 | { | 502 | { |
507 | struct font_desc *fbfont; | 503 | const struct font_desc *fbfont; |
508 | unsigned int size, bpc; | 504 | unsigned int size, bpc; |
509 | void *dest; | 505 | void *dest; |
510 | struct sti_rom_font *nf; | 506 | struct sti_rom_font *nf; |
@@ -525,10 +521,9 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | |||
525 | size = bpc * 256; | 521 | size = bpc * 256; |
526 | size += sizeof(struct sti_rom_font); | 522 | size += sizeof(struct sti_rom_font); |
527 | 523 | ||
528 | nf = kmalloc(size, GFP_KERNEL); | 524 | nf = kzalloc(size, GFP_KERNEL); |
529 | if (!nf) | 525 | if (!nf) |
530 | return NULL; | 526 | return NULL; |
531 | memset(nf, 0, size); | ||
532 | 527 | ||
533 | nf->first_char = 0; | 528 | nf->first_char = 0; |
534 | nf->last_char = 255; | 529 | nf->last_char = 255; |
@@ -544,7 +539,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | |||
544 | dest += sizeof(struct sti_rom_font); | 539 | dest += sizeof(struct sti_rom_font); |
545 | memcpy(dest, fbfont->data, bpc*256); | 540 | memcpy(dest, fbfont->data, bpc*256); |
546 | 541 | ||
547 | cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); | 542 | cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); |
548 | if (!cooked_font) { | 543 | if (!cooked_font) { |
549 | kfree(nf); | 544 | kfree(nf); |
550 | return NULL; | 545 | return NULL; |
@@ -559,7 +554,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name ) | |||
559 | } | 554 | } |
560 | #else | 555 | #else |
561 | struct sti_cooked_font * __init | 556 | struct sti_cooked_font * __init |
562 | sti_select_fbfont(struct sti_cooked_rom *cooked_rom, char *fbfont_name) | 557 | sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) |
563 | { | 558 | { |
564 | return NULL; | 559 | return NULL; |
565 | } | 560 | } |
@@ -617,7 +612,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, | |||
617 | struct sti_rom_font *raw_font, *font_start; | 612 | struct sti_rom_font *raw_font, *font_start; |
618 | struct sti_cooked_font *cooked_font; | 613 | struct sti_cooked_font *cooked_font; |
619 | 614 | ||
620 | cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); | 615 | cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); |
621 | if (!cooked_font) | 616 | if (!cooked_font) |
622 | return 0; | 617 | return 0; |
623 | 618 | ||
@@ -631,7 +626,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, | |||
631 | while (raw_font->next_font) { | 626 | while (raw_font->next_font) { |
632 | raw_font = ((void *)font_start) + (raw_font->next_font); | 627 | raw_font = ((void *)font_start) + (raw_font->next_font); |
633 | 628 | ||
634 | cooked_font->next_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL); | 629 | cooked_font->next_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL); |
635 | if (!cooked_font->next_font) | 630 | if (!cooked_font->next_font) |
636 | return 1; | 631 | return 1; |
637 | 632 | ||
@@ -668,10 +663,9 @@ sti_bmode_font_raw(struct sti_cooked_font *f) | |||
668 | unsigned char *n, *p, *q; | 663 | unsigned char *n, *p, *q; |
669 | int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font); | 664 | int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font); |
670 | 665 | ||
671 | n = kmalloc (4*size, GFP_KERNEL); | 666 | n = kzalloc (4*size, GFP_KERNEL); |
672 | if (!n) | 667 | if (!n) |
673 | return NULL; | 668 | return NULL; |
674 | memset (n, 0, 4*size); | ||
675 | p = n + 3; | 669 | p = n + 3; |
676 | q = (unsigned char *)f->raw; | 670 | q = (unsigned char *)f->raw; |
677 | while (size--) { | 671 | while (size--) { |
@@ -816,13 +810,12 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd | |||
816 | return NULL; | 810 | return NULL; |
817 | } | 811 | } |
818 | 812 | ||
819 | sti = kmalloc(sizeof(*sti), GFP_KERNEL); | 813 | sti = kzalloc(sizeof(*sti), GFP_KERNEL); |
820 | if (!sti) { | 814 | if (!sti) { |
821 | printk(KERN_ERR "Not enough memory !\n"); | 815 | printk(KERN_ERR "Not enough memory !\n"); |
822 | return NULL; | 816 | return NULL; |
823 | } | 817 | } |
824 | 818 | ||
825 | memset(sti, 0, sizeof(*sti)); | ||
826 | spin_lock_init(&sti->lock); | 819 | spin_lock_init(&sti->lock); |
827 | 820 | ||
828 | test_rom: | 821 | test_rom: |
@@ -1035,7 +1028,7 @@ static struct parisc_driver pa_sti_driver = { | |||
1035 | * sti_init_roms() - detects all STI ROMs and stores them in sti_roms[] | 1028 | * sti_init_roms() - detects all STI ROMs and stores them in sti_roms[] |
1036 | */ | 1029 | */ |
1037 | 1030 | ||
1038 | static int sticore_initialized; | 1031 | static int sticore_initialized __read_mostly; |
1039 | 1032 | ||
1040 | static void __init sti_init_roms(void) | 1033 | static void __init sti_init_roms(void) |
1041 | { | 1034 | { |