[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150511135805.GF18474@l.oracle.com>
Date: Mon, 11 May 2015 09:58:05 -0400
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: Hanjun Guo <hanjun.guo@...aro.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
linux-acpi@...r.kernel.org, Will Deacon <will.deacon@....com>,
Catalin Marinas <catalin.marinas@....com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Stefano Stabellini <stefano.stabellini@...citrix.com>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Sudeep Holla <Sudeep.Holla@....com>,
linux-kernel@...r.kernel.org, linaro-acpi@...ts.linaro.org
Subject: Re: [PATCH v3 3/7] Xen / ACPI / processor: Remove unneeded NULL check
On Mon, May 11, 2015 at 12:17:15PM +0800, Hanjun Guo wrote:
> 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@...aro.org>
> CC: Boris Ostrovsky <boris.ostrovsky@...cle.com>
> CC: Stefano Stabellini <stefano.stabellini@...citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> ---
> drivers/xen/xen-acpi-cpuhotplug.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/xen/xen-acpi-cpuhotplug.c b/drivers/xen/xen-acpi-cpuhotplug.c
> index 5a62aa0..f4a3694 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)
> 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 */
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists