diff options
author | Hanjun Guo <hanjun.guo@linaro.org> | 2015-05-11 00:17:15 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-05-13 17:28:15 -0400 |
commit | c867d83855a6c50ac1a33960c9d50a77ff636f64 (patch) | |
tree | 028c69aafae4887a16de24440e263cc1db77492e /drivers/xen/xen-acpi-cpuhotplug.c | |
parent | 16eac059a6800f640423b7b6e2e9fc7091bad102 (diff) |
Xen / ACPI / processor: Remove unneeded NULL check
Before xen_acpi_processor_enable() is called, struct acpi_processor *pr is
allocated in xen_acpi_processor_add() and checked if it's NULL, so no need
to check again when passed to xen_acpi_processor_enable(), just remove it.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/xen/xen-acpi-cpuhotplug.c')
-rw-r--r-- | drivers/xen/xen-acpi-cpuhotplug.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/xen/xen-acpi-cpuhotplug.c b/drivers/xen/xen-acpi-cpuhotplug.c index 5a62aa007d4a..f4a369429553 100644 --- a/drivers/xen/xen-acpi-cpuhotplug.c +++ b/drivers/xen/xen-acpi-cpuhotplug.c | |||
@@ -46,13 +46,7 @@ static int xen_acpi_processor_enable(struct acpi_device *device) | |||
46 | unsigned long long value; | 46 | unsigned long long value; |
47 | union acpi_object object = { 0 }; | 47 | union acpi_object object = { 0 }; |
48 | struct acpi_buffer buffer = { sizeof(union acpi_object), &object }; | 48 | struct acpi_buffer buffer = { sizeof(union acpi_object), &object }; |
49 | struct acpi_processor *pr; | 49 | struct acpi_processor *pr = acpi_driver_data(device); |
50 | |||
51 | pr = acpi_driver_data(device); | ||
52 | if (!pr) { | ||
53 | pr_err(PREFIX "Cannot find driver data\n"); | ||
54 | return -EINVAL; | ||
55 | } | ||
56 | 50 | ||
57 | if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { | 51 | if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { |
58 | /* Declared with "Processor" statement; match ProcessorID */ | 52 | /* Declared with "Processor" statement; match ProcessorID */ |