Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
c867d838 16eac059

+1 -7
+1 -7
drivers/xen/xen-acpi-cpuhotplug.c
··· 46 46 unsigned long long value; 47 47 union acpi_object object = { 0 }; 48 48 struct acpi_buffer buffer = { sizeof(union acpi_object), &object }; 49 - struct acpi_processor *pr; 50 - 51 - pr = acpi_driver_data(device); 52 - if (!pr) { 53 - pr_err(PREFIX "Cannot find driver data\n"); 54 - return -EINVAL; 55 - } 49 + struct acpi_processor *pr = acpi_driver_data(device); 56 50 57 51 if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) { 58 52 /* Declared with "Processor" statement; match ProcessorID */