Skip to content

Commit

Permalink
Xen / ACPI / processor: Remove unneeded NULL check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hanjun-guo authored and rafaeljw committed May 13, 2015
1 parent 16eac05 commit c867d83
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/xen/xen-acpi-cpuhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ static int xen_acpi_processor_enable(struct acpi_device *device)
unsigned long long value;
union acpi_object object = { 0 };
struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
struct acpi_processor *pr;

pr = acpi_driver_data(device);
if (!pr) {
pr_err(PREFIX "Cannot find driver data\n");
return -EINVAL;
}
struct acpi_processor *pr = acpi_driver_data(device);

if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
/* Declared with "Processor" statement; match ProcessorID */
Expand Down

0 comments on commit c867d83

Please sign in to comment.