From patchwork Fri Mar 27 13:55:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46410 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7244721597 for ; Fri, 27 Mar 2015 13:56:38 +0000 (UTC) Received: by wgfh4 with SMTP id h4sf11116421wgf.1 for ; Fri, 27 Mar 2015 06:56:37 -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=z+uX+vAgChKSSC5GVugNRZ0FObWwUH0VuLjuwE4NlMM=; b=fgGPa+Ev0zLQSlsma4MNNvh+ScO5xqxpTP20YrUmJ1AMZK4ph1VcJQ9muKiIWdxTTb 4y9IXuOWbAR7e3nYf8uxp1osJZfF7DeBktaFKgG1O8lvidyuHpnEwukxAw8GOCSQPgVK TLHdZ97yRrlo65xP6/fDzKpvuoE4Xy9d5kPEvmXB4MUtI59WfGfxI1LHkqZMejReGbq7 Y9VswyMz96mw3fZuU/z8It77HGkC0TrniwLK+wAR5aZFlELjce3lMKqHdGPqGqVVaDyN 8A06je21Xu3gYFktqWHT/Miy6K1Ph9xjjZfRkdd6Yhs7WEn9aPBMPV0fKUq/uGnK0X0C RXbg== X-Gm-Message-State: ALoCoQn9lcV+ayyVJfUxUPGqIjJBZuEqzS3SGxerXRpNKIFrNl5/wWGAk7ik6q8kbX1Z2TIKmEMd X-Received: by 10.112.162.135 with SMTP id ya7mr4643020lbb.14.1427464597732; Fri, 27 Mar 2015 06:56:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.129 with SMTP id ay1ls202231lab.61.gmail; Fri, 27 Mar 2015 06:56:37 -0700 (PDT) X-Received: by 10.152.10.66 with SMTP id g2mr17916633lab.44.1427464597566; Fri, 27 Mar 2015 06:56:37 -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 rt5si1441882lac.158.2015.03.27.06.56.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 06:56:37 -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 lbbug6 with SMTP id ug6so64114894lbb.3 for ; Fri, 27 Mar 2015 06:56:37 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr17916478lac.36.1427464597222; Fri, 27 Mar 2015 06:56:37 -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.57.201 with SMTP id k9csp1276019lbq; Fri, 27 Mar 2015 06:56:36 -0700 (PDT) X-Received: by 10.70.9.131 with SMTP id z3mr9945588pda.156.1427464591983; Fri, 27 Mar 2015 06:56:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn1si2940342pbb.242.2015.03.27.06.56.31; Fri, 27 Mar 2015 06:56:31 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S964819AbbC0N4V (ORCPT + 27 others); Fri, 27 Mar 2015 09:56:21 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:34785 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964801AbbC0N4S (ORCPT ); Fri, 27 Mar 2015 09:56:18 -0400 Received: by pdbni2 with SMTP id ni2so97332787pdb.1 for ; Fri, 27 Mar 2015 06:56:17 -0700 (PDT) X-Received: by 10.68.163.101 with SMTP id yh5mr36015713pbb.92.1427464577732; Fri, 27 Mar 2015 06:56:17 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id gg5sm2287238pbb.86.2015.03.27.06.56.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 06:56:17 -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 5/7] Xen / ACPI / processor: Remove unneeded NULL check in xen_acpi_processor_enable() Date: Fri, 27 Mar 2015 21:55:11 +0800 Message-Id: <1427464513-14414-8-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427464513-14414-1-git-send-email-hanjun.guo@linaro.org> References: <1427464513-14414-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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 */