From patchwork Tue May 5 02:46:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48014 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4F82F2121F for ; Tue, 5 May 2015 02:49:18 +0000 (UTC) Received: by laat2 with SMTP id t2sf50836135laa.2 for ; Mon, 04 May 2015 19:49:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=S0MyuR4+jtqk3QuG2XODmJRgdo2ymT0IbaNN78e0ihg=; b=bdQx7fZ4j9i0Fp4h4onh5CKj4FAfz0ooskoGFWy9GR5QFE4AUMps03kN4cnAe3g2Va nXdupUIS8yLFQn1SXo0nSzNN6DaioYqmnEq5THHEty9P3RUrfEMeihkYR5yp37heP71w b70kPWtoEmyo0DqV9Ml4LAFRiNOaQq0kMArm6zcJIYFYAo/jSV7iON5Fq8/m9GuLqv+g 0oucthk2kuO2UBR+N/TShUD9AnMQyd0nhQnS1/UE5hVo4BpJJlKd0lwB93pzd0FisAjW C6V6VKkQMoNt9irkdMAjLJwLNiUIi77Gbz9WDLcE+0Qk4hYc30emyACE9TsvB3qHTm6z +x+Q== X-Gm-Message-State: ALoCoQnNx+N4Y7xEbSATRCPWkgx1JDI0f3AHfbPvwV9dr/dLlDlYYQdSPRIeKemKT1uuakImFYa6 X-Received: by 10.112.13.200 with SMTP id j8mr20619063lbc.14.1430794157238; Mon, 04 May 2015 19:49:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.231 with SMTP id i7ls758533lae.85.gmail; Mon, 04 May 2015 19:49:17 -0700 (PDT) X-Received: by 10.112.160.73 with SMTP id xi9mr21280291lbb.92.1430794157098; Mon, 04 May 2015 19:49:17 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id wx3si11278397lbb.142.2015.05.04.19.49.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 19:49:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbcga7 with SMTP id ga7so118323567lbc.1 for ; Mon, 04 May 2015 19:49:17 -0700 (PDT) X-Received: by 10.112.16.196 with SMTP id i4mr21646097lbd.72.1430794156972; Mon, 04 May 2015 19:49:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1987682lbt; Mon, 4 May 2015 19:49:16 -0700 (PDT) X-Received: by 10.68.246.133 with SMTP id xw5mr22318371pbc.116.1430794155106; Mon, 04 May 2015 19:49:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb6si22253324pab.42.2015.05.04.19.49.14; Mon, 04 May 2015 19:49:15 -0700 (PDT) Received-SPF: none (google.com: linux-acpi-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965435AbbEECs6 (ORCPT + 7 others); Mon, 4 May 2015 22:48:58 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:35034 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965429AbbEECrx (ORCPT ); Mon, 4 May 2015 22:47:53 -0400 Received: by pdbqd1 with SMTP id qd1so180582980pdb.2 for ; Mon, 04 May 2015 19:47:51 -0700 (PDT) X-Received: by 10.67.4.161 with SMTP id cf1mr47524496pad.35.1430794071629; Mon, 04 May 2015 19:47:51 -0700 (PDT) Received: from localhost ([180.150.157.4]) by mx.google.com with ESMTPSA id dv3sm14069860pbb.91.2015.05.04.19.47.50 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 May 2015 19:47:50 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" Cc: Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v2 5/7] Xen / ACPI / processor: Remove unneeded NULL check in xen_acpi_processor_enable() Date: Tue, 5 May 2015 10:46:36 +0800 Message-Id: <1430793998-21631-6-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430793998-21631-1-git-send-email-hanjun.guo@linaro.org> References: <1430793998-21631-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 */