From patchwork Mon May 11 04:17:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48196 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3ADEC21550 for ; Mon, 11 May 2015 04:18:32 +0000 (UTC) Received: by wixv7 with SMTP id v7sf22371365wix.0 for ; Sun, 10 May 2015 21:18:31 -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=BbPysJ7+d2vdBKlCbFTZ2pC3nXzhe4IrvE1XpnJ17e+AXieQEB/nYrNRtivkEpG45g rAGUZZ7da1DwA6Mj0BfAQ92akJmjSk1dUkW5jP4QiTnX5VgUfNjHBXNQ/qpq1RLQKepf xcIQFrWuBQCg1y5UECDSYMzYc0kbEzLgrT91GlDsv3emVvAnDUEVNhvwI9/a4w0SY4mi JH+qTjNhDge9+yEr9BHzzth2QdeWn9poem7R8UOho4bK1YW2I2ZFP3cpN++Oct7k+Czt DR4vJdCTnBjMifKuODxNDh8SRZU3uacAVwf7TtV7RzAzadyhXrwjPXhGWFKi7NGMBJmH je9A== X-Gm-Message-State: ALoCoQnauhpH2h73SOAJCb9t+IDFNitwCoV/7Su7wUxFo51eyuSFyJzR5dEyBE+A7Aa4xeBxfnVU X-Received: by 10.112.51.68 with SMTP id i4mr6307770lbo.13.1431317911492; Sun, 10 May 2015 21:18:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.71 with SMTP id k7ls598579lam.99.gmail; Sun, 10 May 2015 21:18:31 -0700 (PDT) X-Received: by 10.112.235.133 with SMTP id um5mr6788832lbc.7.1431317911343; Sun, 10 May 2015 21:18:31 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id x9si7664012lal.18.2015.05.10.21.18.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 May 2015 21:18:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lagv1 with SMTP id v1so84954553lag.3 for ; Sun, 10 May 2015 21:18:31 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr6843840lbc.32.1431317911065; Sun, 10 May 2015 21:18:31 -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.108.230 with SMTP id hn6csp1290292lbb; Sun, 10 May 2015 21:18:30 -0700 (PDT) X-Received: by 10.68.210.46 with SMTP id mr14mr15897458pbc.73.1431317909402; Sun, 10 May 2015 21:18:29 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wt10si16329782pab.236.2015.05.10.21.18.28; Sun, 10 May 2015 21:18:29 -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 S1752261AbbEKESU (ORCPT + 7 others); Mon, 11 May 2015 00:18:20 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:35003 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752290AbbEKESP (ORCPT ); Mon, 11 May 2015 00:18:15 -0400 Received: by pdbqd1 with SMTP id qd1so136358050pdb.2 for ; Sun, 10 May 2015 21:18:14 -0700 (PDT) X-Received: by 10.68.161.99 with SMTP id xr3mr15872233pbb.47.1431317894438; Sun, 10 May 2015 21:18:14 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id da2sm11499174pbb.57.2015.05.10.21.18.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 10 May 2015 21:18:13 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Will Deacon , Catalin Marinas , Boris Ostrovsky , Stefano Stabellini , Lorenzo Pieralisi , Sudeep Holla , Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v3 3/7] Xen / ACPI / processor: Remove unneeded NULL check Date: Mon, 11 May 2015 12:17:15 +0800 Message-Id: <1431317839-4584-4-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431317839-4584-1-git-send-email-hanjun.guo@linaro.org> References: <1431317839-4584-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.215.47 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 */