All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ACPI: Remove unnecessary code in acpi drivers
@ 2009-09-14 16:09 Alan Jenkins
  2009-09-14 16:09 ` [PATCH 1/4] ACPI: Remember to clear acpi_dev->driver after calling ops.remove() Alan Jenkins
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Alan Jenkins @ 2009-09-14 16:09 UTC (permalink / raw)
  To: lenb; +Cc: bjorn.helgaas, linux-acpi

Bjorn critiqued some code in a new acpi driver as unnecesary. However,
the same code patterns are present in most acpi drivers.  Let's remove
them all.

The first patch ammends acpi/scan.c so that the following NULL
assignment pattern can be removed with complete confidence:

    acpi_driver_remove(acpi_device *device, int removal_type) 
    {
	...
	device->driverdata = NULL;
    }

Some failure paths in scan.c were omitting to clear device->driverdata,
and more seriously device->driver, so I fixed that before removing the
NULL assignments from drivers.

In total this removes ~150 lines.

 drivers/acpi/ac.c                       |   23 +++------------
 drivers/acpi/acpi_memhotplug.c          |   13 ++-------
 drivers/acpi/battery.c                  |   18 +++---------
 drivers/acpi/container.c                |   12 ++------
 drivers/acpi/ec.c                       |    9 +-----
 drivers/acpi/fan.c                      |   14 +---------
 drivers/acpi/pci_link.c                 |   11 ++++---
 drivers/acpi/power.c                    |   19 ++-----------
 drivers/acpi/processor_core.c           |    7 +----
 drivers/acpi/sbs.c                      |   11 +------
 drivers/acpi/sbshc.c                    |   17 +----------
 drivers/acpi/scan.c                     |   45 ++++++++++++++++++------------
 drivers/acpi/thermal.c                  |   21 +++-----------
 drivers/acpi/video.c                    |   17 ++---------
 drivers/hwmon/asus_atk0110.c            |    2 -
 drivers/hwmon/hp_accel.c                |    9 ------
 drivers/input/misc/atlas_btns.c         |    5 +---
 drivers/platform/x86/asus-laptop.c      |    9 ------
 drivers/platform/x86/asus_acpi.c        |    9 ------
 drivers/platform/x86/eeepc-laptop.c     |    7 -----
 drivers/platform/x86/fujitsu-laptop.c   |    6 ----
 drivers/platform/x86/intel_menlow.c     |    6 ----
 drivers/platform/x86/panasonic-laptop.c |   16 +---------
 drivers/platform/x86/wmi.c              |    3 --
24 files changed, 70 insertions(+), 239 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-15 10:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14 16:09 [PATCH 0/4] ACPI: Remove unnecessary code in acpi drivers Alan Jenkins
2009-09-14 16:09 ` [PATCH 1/4] ACPI: Remember to clear acpi_dev->driver after calling ops.remove() Alan Jenkins
2009-09-14 16:09 ` [PATCH 2/4] ACPI: Remove uneccessary NULL assignments in acpi drivers Alan Jenkins
2009-09-14 16:09 ` [PATCH 3/4] ACPI: Remove redundant NULL checks " Alan Jenkins
2009-09-14 19:39   ` Bjorn Helgaas
2009-09-15 10:11     ` [PATCHv2 " Alan Jenkins
2009-09-14 16:09 ` [PATCH 4/4] ACPI: Remove uneccesary acpi_disabled " Alan Jenkins
2009-09-14 19:46   ` Bjorn Helgaas
2009-09-15 10:11     ` [PATCHv2 4/4] ACPI: Remove unneccesary " Alan Jenkins

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.