From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185AbbEKN6W (ORCPT ); Mon, 11 May 2015 09:58:22 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22495 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbbEKN6U (ORCPT ); Mon, 11 May 2015 09:58:20 -0400 Date: Mon, 11 May 2015 09:58:05 -0400 From: Konrad Rzeszutek Wilk To: Hanjun Guo Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org Subject: Re: [PATCH v3 3/7] Xen / ACPI / processor: Remove unneeded NULL check Message-ID: <20150511135805.GF18474@l.oracle.com> References: <1431317839-4584-1-git-send-email-hanjun.guo@linaro.org> <1431317839-4584-4-git-send-email-hanjun.guo@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431317839-4584-4-git-send-email-hanjun.guo@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > CC: Boris Ostrovsky > CC: Stefano Stabellini Reviewed-by: Konrad Rzeszutek Wilk > --- > 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 >