From: Alex Chiang <achiang@hp.com>
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] ACPI: dock: rename local variable 'dock_station' in dock_add()
Date: Wed, 07 Oct 2009 16:07:37 -0600 [thread overview]
Message-ID: <20091007220737.15597.75265.stgit@bob.kio> (raw)
In-Reply-To: <20091007220509.15597.65501.stgit@bob.kio>
Shorten the name of 'dock_station' to 'ds'.
No functional change.
It will help later on with some whitespace and legibility issues.
Signed-off-by: Alex Chiang <achiang@hp.com>
---
drivers/acpi/dock.c | 46 +++++++++++++++++++++++-----------------------
1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index a8f81c0..390adee 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -947,44 +947,44 @@ static int dock_add(acpi_handle handle)
{
int ret;
struct dock_dependent_device *dd;
- struct dock_station *dock_station;
+ struct dock_station *ds;
struct platform_device *dock_device;
/* allocate & initialize the dock_station private data */
- dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL);
- if (!dock_station)
+ ds = kzalloc(sizeof(struct dock_station), GFP_KERNEL);
+ if (!ds)
return -ENOMEM;
- dock_station->handle = handle;
- dock_station->last_dock_time = jiffies - HZ;
- INIT_LIST_HEAD(&dock_station->dependent_devices);
- INIT_LIST_HEAD(&dock_station->hotplug_devices);
- INIT_LIST_HEAD(&dock_station->sibling);
- spin_lock_init(&dock_station->dd_lock);
- mutex_init(&dock_station->hp_lock);
+ ds->handle = handle;
+ ds->last_dock_time = jiffies - HZ;
+ INIT_LIST_HEAD(&ds->dependent_devices);
+ INIT_LIST_HEAD(&ds->hotplug_devices);
+ INIT_LIST_HEAD(&ds->sibling);
+ spin_lock_init(&ds->dd_lock);
+ mutex_init(&ds->hp_lock);
ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list);
/* initialize platform device stuff */
- dock_station->dock_device =
+ ds->dock_device =
platform_device_register_simple(dock_device_name,
dock_station_count, NULL, 0);
- dock_device = dock_station->dock_device;
+ dock_device = ds->dock_device;
if (IS_ERR(dock_device)) {
- kfree(dock_station);
- dock_station = NULL;
+ kfree(ds);
+ ds = NULL;
return PTR_ERR(dock_device);
}
- platform_device_add_data(dock_device, &dock_station,
+ platform_device_add_data(dock_device, &ds,
sizeof(struct dock_station *));
/* we want the dock device to send uevents */
dev_set_uevent_suppress(&dock_device->dev, 0);
if (is_dock(handle))
- dock_station->flags |= DOCK_IS_DOCK;
+ ds->flags |= DOCK_IS_DOCK;
if (is_ata(handle))
- dock_station->flags |= DOCK_IS_ATA;
+ ds->flags |= DOCK_IS_ATA;
if (is_battery(handle))
- dock_station->flags |= DOCK_IS_BAT;
+ ds->flags |= DOCK_IS_BAT;
ret = device_create_file(&dock_device->dev, &dev_attr_docked);
if (ret)
@@ -1008,7 +1008,7 @@ static int dock_add(acpi_handle handle)
/* Find dependent devices */
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, find_dock_devices, dock_station,
+ ACPI_UINT32_MAX, find_dock_devices, ds,
NULL);
/* add the dock station as a device dependent on itself */
@@ -1017,10 +1017,10 @@ static int dock_add(acpi_handle handle)
ret = -ENOMEM;
goto err_unregister5;
}
- add_dock_dependent_device(dock_station, dd);
+ add_dock_dependent_device(ds, dd);
dock_station_count++;
- list_add(&dock_station->sibling, &dock_stations);
+ list_add(&ds->sibling, &dock_stations);
return 0;
err_unregister5:
@@ -1036,8 +1036,8 @@ err_unregister1:
err_unregister:
printk(KERN_ERR "%s encountered error %d\n", __func__, ret);
platform_device_unregister(dock_device);
- kfree(dock_station);
- dock_station = NULL;
+ kfree(ds);
+ ds = NULL;
return ret;
}
next prev parent reply other threads:[~2009-10-07 22:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 22:07 [PATCH 0/6] ACPI: dock: code hygiene Alex Chiang
2009-10-07 22:07 ` [PATCH 1/6] ACPI: dock: clean up error handling paths in dock_add() Alex Chiang
2009-10-07 22:07 ` Alex Chiang [this message]
2009-10-07 22:07 ` [PATCH 3/6] ACPI: dock: clean up one more error path " Alex Chiang
2009-10-07 22:07 ` [PATCH 4/6] ACPI: dock: add struct dock_station * directly to platform device data Alex Chiang
2009-10-10 7:52 ` Shaohua Li
2009-10-12 17:17 ` Alex Chiang
2009-10-07 22:07 ` [PATCH 5/6] ACPI: dock: combine add|alloc_dock_dependent_device Alex Chiang
2009-10-07 22:07 ` [PATCH 6/6] ACPI: dock: minor whitespace and style cleanups Alex Chiang
2009-10-09 20:55 ` [PATCH 0/6] ACPI: dock: code hygiene Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091007220737.15597.75265.stgit@bob.kio \
--to=achiang@hp.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®