From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757842AbbEEK3h (ORCPT ); Tue, 5 May 2015 06:29:37 -0400 Received: from smtp.citrix.com ([66.165.176.89]:50385 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752347AbbEEK32 (ORCPT ); Tue, 5 May 2015 06:29:28 -0400 X-IronPort-AV: E=Sophos;i="5.13,372,1427760000"; d="scan'208";a="259475075" Date: Tue, 5 May 2015 11:29:05 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Hanjun Guo CC: "Rafael J. Wysocki" , Will Deacon , Catalin Marinas , "Boris Ostrovsky" , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , , , , Konrad Rzeszutek Wilk , David Vrabel Subject: Re: [PATCH v2 5/7] Xen / ACPI / processor: Remove unneeded NULL check in xen_acpi_processor_enable() In-Reply-To: <1430793998-21631-6-git-send-email-hanjun.guo@linaro.org> Message-ID: References: <1430793998-21631-1-git-send-email-hanjun.guo@linaro.org> <1430793998-21631-6-git-send-email-hanjun.guo@linaro.org> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CC'ing Konrad and David. On Tue, 5 May 2015, 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 > CC: Boris Ostrovsky > CC: Stefano Stabellini > --- > 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 >