lkml.org 
[lkml]   [2008]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 11/15] PCI: rpaphp: kmalloc/kfree slot->name directly
    Date
    rpaphp tends to use slot->name directly everywhere, and doesn't
    ever need slot->hotplug_slot->name.

    struct hotplug_slot->name is going away, so convert rpaphp directly
    manipulate its own slot->name everywhere, and don't bother touching
    slot->hotplug_slot->name.

    Signed-off-by: Alex Chiang <achiang@hp.com>
    ---

    drivers/pci/hotplug/rpaphp_slot.c | 7 +++----
    1 files changed, 3 insertions(+), 4 deletions(-)

    diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
    index 736d3b4..7297e85 100644
    --- a/drivers/pci/hotplug/rpaphp_slot.c
    +++ b/drivers/pci/hotplug/rpaphp_slot.c
    @@ -43,7 +43,7 @@ static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot)
    void dealloc_slot_struct(struct slot *slot)
    {
    kfree(slot->hotplug_slot->info);
    - kfree(slot->hotplug_slot->name);
    + kfree(slot->name);
    kfree(slot->hotplug_slot);
    kfree(slot);
    }
    @@ -63,10 +63,9 @@ struct slot *alloc_slot_struct(struct device_node *dn,
    GFP_KERNEL);
    if (!slot->hotplug_slot->info)
    goto error_hpslot;
    - slot->hotplug_slot->name = kmalloc(strlen(drc_name) + 1, GFP_KERNEL);
    - if (!slot->hotplug_slot->name)
    + slot->name = kmalloc(strlen(drc_name) + 1, GFP_KERNEL);
    + if (!slot->name)
    goto error_info;
    - slot->name = slot->hotplug_slot->name;
    strcpy(slot->name, drc_name);
    slot->dn = dn;
    slot->index = drc_index;


    \
     
     \ /
      Last update: 2008-10-04 01:23    [W:0.023 / U:4.048 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site