some kmalloc/memset ->kzalloc (tree wide)
[safe/jmp/linux-2.6] / drivers / misc / ibmasm / module.c
index 9706cc1..4f9d4a9 100644 (file)
@@ -18,9 +18,9 @@
  *
  * Copyright (C) IBM Corporation, 2004
  *
- * Author: Max Asböck <amax@us.ibm.com> 
+ * Author: Max Asböck <amax@us.ibm.com>
  *
- * This driver is based on code originally written by Pete Reynolds 
+ * This driver is based on code originally written by Pete Reynolds
  * and others.
  *
  */
  *
  * 1) When loaded it sends a message to the service processor,
  * indicating that an OS is * running. This causes the service processor
- * to send periodic heartbeats to the OS. 
+ * to send periodic heartbeats to the OS.
  *
  * 2) Answers the periodic heartbeats sent by the service processor.
  * Failure to do so would result in system reboot.
  *
  * 3) Acts as a pass through for dot commands sent from user applications.
- * The interface for this is the ibmasmfs file system. 
+ * The interface for this is the ibmasmfs file system.
  *
  * 4) Allows user applications to register for event notification. Events
  * are sent to the driver through interrupts. They can be read from user
@@ -77,13 +77,12 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
        /* vnc client won't work without bus-mastering */
        pci_set_master(pdev);
 
-       sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
+       sp = kzalloc(sizeof(struct service_processor), GFP_KERNEL);
        if (sp == NULL) {
                dev_err(&pdev->dev, "Failed to allocate memory\n");
                result = -ENOMEM;
                goto error_kmalloc;
        }
-       memset(sp, 0, sizeof(struct service_processor));
 
        spin_lock_init(&sp->lock);
        INIT_LIST_HEAD(&sp->command_queue);
@@ -105,7 +104,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
        }
 
        sp->irq = pdev->irq;
-       sp->base_address = ioremap(pci_resource_start(pdev, 0), 
+       sp->base_address = ioremap(pci_resource_start(pdev, 0),
                                        pci_resource_len(pdev, 0));
        if (sp->base_address == 0) {
                dev_err(sp->dev, "Failed to ioremap pci memory\n");
@@ -113,7 +112,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
                goto error_ioremap;
        }
 
-       result = request_irq(sp->irq, ibmasm_interrupt_handler, SA_SHIRQ, sp->devname, (void*)sp);
+       result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp);
        if (result) {
                dev_err(sp->dev, "Failed to register interrupt handler\n");
                goto error_request_irq;