ACPI / dock: Drop unnecessary local variable from dock_add()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 5 Jul 2013 01:23:36 +0000 (03:23 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 14 Jul 2013 23:33:12 +0000 (01:33 +0200)
The local variable id in dock_add() is not necessary, so drop it.

While we're at it, use an initializer to clear the local variable ds
and drop the memset() used for this purpose.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/dock.c

index c89a9c3b48b48a36b0e88e1a2bbb04cfd73a631f..f601658a4ad2856464b0e137694b75c29d04d0f5 100644 (file)
@@ -836,14 +836,13 @@ static struct attribute_group dock_attribute_group = {
  */
 static int __init dock_add(acpi_handle handle)
 {
-       int ret, id;
-       struct dock_station ds, *dock_station;
+       struct dock_station *dock_station, ds = { NULL, };
        struct platform_device *dd;
        acpi_status status;
+       int ret;
 
-       id = dock_station_count;
-       memset(&ds, 0, sizeof(ds));
-       dd = platform_device_register_data(NULL, "dock", id, &ds, sizeof(ds));
+       dd = platform_device_register_data(NULL, "dock", dock_station_count,
+                                          &ds, sizeof(ds));
        if (IS_ERR(dd))
                return PTR_ERR(dd);