From patchwork Tue May 16 05:22:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 9728343 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D94360386 for ; Tue, 16 May 2017 05:23:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 507DE286EF for ; Tue, 16 May 2017 05:23:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44848289E3; Tue, 16 May 2017 05:23:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCC94286F3 for ; Tue, 16 May 2017 05:23:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751491AbdEPFXE (ORCPT ); Tue, 16 May 2017 01:23:04 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:32947 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbdEPFXC (ORCPT ); Tue, 16 May 2017 01:23:02 -0400 Received: by mail-pg0-f52.google.com with SMTP id u187so70590924pgb.0 for ; Mon, 15 May 2017 22:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=erxYm/LN1hRpZI6cZp+O9MdG45Rnq3oF5lp3Pv39/I8=; b=AqxYoh2U6UZiGOtT44GljK+QTD+bEkUJAvt8w/oLiYl/hTseTzGVktWwswsSW29epX GjmkdmcH2KLAF0WjLDy+N3GkWojP+DkeF1+lcmtIIzz2cu29rIbEnnv5rQrl9WzM9iDt +t/rquiC1/B2SeZjPpGJfOKLC1vZhI1K1kxso= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=erxYm/LN1hRpZI6cZp+O9MdG45Rnq3oF5lp3Pv39/I8=; b=ltQiOFhMvkUI+w3ADArzRL/uoY88fvl3Is/Codl+GhGBqpWCRMAYcHer+em0DwGxT/ eeDwjbiaolnckbKXIp2aC8WhP42tS8GahQUylEDx+Uyd7H2jJNcfVvHDkehaYUXer09R yzKn78bQbKL/C0jT9ZMERGVhiw+Q5vwuVXxpO2APlWhiw8hVGEAndLQiEwL6dsLU908X /B7qjxwh2BR14LabdrUF88nO+P1RecnUSLKsZ3dY6iCONfzr4lr0rra/TUSctTq5VFM2 f3PxJ4YX/KcaXVWzaVZhw/hMM2hQ6L8RS9SOptQ6DNBWHyMbxrbuGtT5EkEoKOaAF0Z3 aqLw== X-Gm-Message-State: AODbwcAvvYCoGw07JJIcbPLumtgjw+0NNacUafv7RA9e9JPKCtmIeHOu ig2aNBKX9yvPa4pH X-Received: by 10.99.42.199 with SMTP id q190mr9823609pgq.13.1494912176936; Mon, 15 May 2017 22:22:56 -0700 (PDT) Received: from localhost ([122.172.66.217]) by smtp.gmail.com with ESMTPSA id r21sm23172016pfg.95.2017.05.15.22.22.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 22:22:55 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar Subject: [PATCH] PM / Domains: pdd->dev can't be NULL in genpd_dev_pm_qos_notifier() Date: Tue, 16 May 2017 10:52:43 +0530 Message-Id: <201976beb620010271d6f842abbc40a93f55bd73.1494912124.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.13.0.303.g4ebf3021692d Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pm_domain_data (pdd) pointer is set from genpd_alloc_dev_data() and pdd->dev is guaranteed to be valid. There is no need to check pdd and pdd->dev in rest of the code as pdd->dev will always be valid for a non NULL pdd pointer. Signed-off-by: Viresh Kumar Acked-by: Ulf Hansson --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index da49a8383dc3..71c95ad808d5 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -443,7 +443,7 @@ static int genpd_dev_pm_qos_notifier(struct notifier_block *nb, pdd = dev->power.subsys_data ? dev->power.subsys_data->domain_data : NULL; - if (pdd && pdd->dev) { + if (pdd) { to_gpd_data(pdd)->td.constraint_changed = true; genpd = dev_to_genpd(dev); } else {