Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp484170ybm; Thu, 28 May 2020 07:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu9c5SBpbPeKBUyEPGoLzDmAeUtunPpayIe1wmBBvtsLlCvY5fM6pT4JtIi6W0AWqkJ3o1 X-Received: by 2002:a50:c90c:: with SMTP id o12mr3536107edh.294.1590677258355; Thu, 28 May 2020 07:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590677258; cv=none; d=google.com; s=arc-20160816; b=mcFSy4Cb1CKSSekOgQyQSHfVoTBueilomSWSe/fb/7uPFvnraXPYzKJTRXSlhhthBF pUJGZR/62YWmQO0fvG5xgMuRf1nfqvNSmxerxy1WtnJQGuXpT3AirXfA5Pv5Ef4qsr1l nuiN8OvTOrB70yPG6125bvXDFcuiG328Yu7HkOEoGP257oGYWvevopcLqvdIO0ieqcNK vfsli5AeCYIS8rbrj+kgfixREjibklod6P8CpyRYF9uOOMGW8zeevUzn+QomSrx3VS0T xkCf0n+MSmlYCZJ/e1AXK4FTCtcvV7X3NvN3KmDQujAEJj4SEJtZESHBHLfpq2iiUr38 Bo/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=d/rrTDNuBLLRGdbSbrcFT68N00UY+CxCxd769Cpio2A=; b=SnhEpoPtGkxoIsiLQyrrxoY6ouRGtC6HxEKCklT1hFxfgtGVJf3ErZl88C8FLtDieQ wkXCb4aNMpdicN8GwgGYlqwAfGiex/6wTh0mP0aBEZIM8iJbrbY3TbHmuWQekthHqoS9 IqBPHhO0ZI8QpADyAvUizMuUEYz7ZVTOsoaa/EONjG2G5EnckTlAgYQSdxbT8G7qPys/ QEd/mHdFm/HJT6WPeS1I3Vjj13tVhlfwvltpUZa8xgKD9NxVWR8BzhyerIR9srtmmnN5 o2NvtqWSGOwvGwiG3sP2yoSNSCW0j/uy7JjHyu/W800pTnBRU+M2VLH5ttrTmYohygNY 8njA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si3908203edm.499.2020.05.28.07.47.14; Thu, 28 May 2020 07:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728584AbgE1OpT (ORCPT + 99 others); Thu, 28 May 2020 10:45:19 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:51034 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbgE1OpR (ORCPT ); Thu, 28 May 2020 10:45:17 -0400 Received: from 89-64-85-246.dynamic.chello.pl (89.64.85.246) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 1520e6f1e392a6c6; Thu, 28 May 2020 16:45:15 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , "Rafael J. Wysocki" , Ulf Hansson Subject: [PATCH] PM: runtime: Replace pm_runtime_callbacks_present() Date: Thu, 28 May 2020 16:45:14 +0200 Message-ID: <2735489.s4WY8YHBoM@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki The name of pm_runtime_callbacks_present() is confusing, because it suggests that the device has PM-runtime callbacks if 'true' is returned by that function, but in fact that may not be the case, so replace it with pm_runtime_has_no_callbacks() which is not ambiguous. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/base/power/sysfs.c | 4 ++-- include/linux/pm_runtime.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: linux-pm/include/linux/pm_runtime.h =================================================================== --- linux-pm.orig/include/linux/pm_runtime.h +++ linux-pm/include/linux/pm_runtime.h @@ -102,9 +102,9 @@ static inline bool pm_runtime_enabled(st return !dev->power.disable_depth; } -static inline bool pm_runtime_callbacks_present(struct device *dev) +static inline bool pm_runtime_has_no_callbacks(struct device *dev) { - return !dev->power.no_callbacks; + return dev->power.no_callbacks; } static inline void pm_runtime_mark_last_busy(struct device *dev) Index: linux-pm/drivers/base/power/sysfs.c =================================================================== --- linux-pm.orig/drivers/base/power/sysfs.c +++ linux-pm/drivers/base/power/sysfs.c @@ -666,7 +666,7 @@ int dpm_sysfs_add(struct device *dev) if (rc) return rc; - if (pm_runtime_callbacks_present(dev)) { + if (!pm_runtime_has_no_callbacks(dev)) { rc = sysfs_merge_group(&dev->kobj, &pm_runtime_attr_group); if (rc) goto err_out; @@ -709,7 +709,7 @@ int dpm_sysfs_change_owner(struct device if (rc) return rc; - if (pm_runtime_callbacks_present(dev)) { + if (!pm_runtime_has_no_callbacks(dev)) { rc = sysfs_group_change_owner( &dev->kobj, &pm_runtime_attr_group, kuid, kgid); if (rc)