From patchwork Fri Mar 27 14:02:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 46424 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5131521597 for ; Fri, 27 Mar 2015 14:04:41 +0000 (UTC) Received: by lbcgc5 with SMTP id gc5sf3738335lbc.1 for ; Fri, 27 Mar 2015 07:04:40 -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=VgK4ZNtIuzPKVYRBFt+uSXLvJXT0gtynxHUTQowYZsYTDBky84gEaRVZ+KFO9AL3iG crwKIOysqx+bOkZv3mRmFzhcoPBXfUxbdG3KZDUaKLd2MT9bFSE3j1ihy7Nrlt8yVn59 1RBPG2cE07Ox6FAi3Tcjxn8mA+fJzP1P4Uj65Lu5q/KVo4ekp40+Y1pj5RVp0e1pkLAy 6vp6sCtjgk1iw3hOVvRNzbXtbzcQUl6Ymit3MWAS4QVO0wf2RoVEd8K3pBFkfFzj4+oV zqpzn5e2T2AOq8nP7tBJ44Fyt9heiAHw4BcyDgLKvUGTFTMjr0yIgSFVvCL50ZsmshMg CYeA== X-Gm-Message-State: ALoCoQmR2eUVhxgPz2X2iTMPhRKnxtAOLGg8jwieGTti8yt3w5ebDHShMBoF+M0pgC9xjRpMNHVx X-Received: by 10.112.170.38 with SMTP id aj6mr4498404lbc.4.1427465079911; Fri, 27 Mar 2015 07:04:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.165 with SMTP id rd5ls356271lac.77.gmail; Fri, 27 Mar 2015 07:04:39 -0700 (PDT) X-Received: by 10.152.43.3 with SMTP id s3mr18091609lal.101.1427465079737; Fri, 27 Mar 2015 07:04:39 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id lk7si1462466lac.104.2015.03.27.07.04.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 07:04:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcmq2 with SMTP id mq2so64328402lbc.0 for ; Fri, 27 Mar 2015 07:04:39 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr17604681laf.117.1427465079565; Fri, 27 Mar 2015 07:04:39 -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 k9csp1280900lbq; Fri, 27 Mar 2015 07:04:28 -0700 (PDT) X-Received: by 10.68.138.230 with SMTP id qt6mr10172908pbb.66.1427465065759; Fri, 27 Mar 2015 07:04:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ze3si2974986pbc.209.2015.03.27.07.04.24; Fri, 27 Mar 2015 07:04:25 -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 S932172AbbC0OEE (ORCPT + 27 others); Fri, 27 Mar 2015 10:04:04 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:36517 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030207AbbC0OEA (ORCPT ); Fri, 27 Mar 2015 10:04:00 -0400 Received: by pdcp1 with SMTP id p1so5934978pdc.3 for ; Fri, 27 Mar 2015 07:03:59 -0700 (PDT) X-Received: by 10.70.127.140 with SMTP id ng12mr36385497pdb.24.1427465039811; Fri, 27 Mar 2015 07:03:59 -0700 (PDT) Received: from localhost ([104.207.83.1]) by mx.google.com with ESMTPSA id k9sm2329180pdp.24.2015.03.27.07.03.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Mar 2015 07:03:58 -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 22:02:26 +0800 Message-Id: <1427464948-14564-6-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427464948-14564-1-git-send-email-hanjun.guo@linaro.org> References: <1427464948-14564-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.179 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 */