From patchwork Fri Sep 7 20:08:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fieah Lim X-Patchwork-Id: 10592519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36C51920 for ; Fri, 7 Sep 2018 20:09:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A0672B936 for ; Fri, 7 Sep 2018 20:09:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DF712B953; Fri, 7 Sep 2018 20:09: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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 2FCD42B936 for ; Fri, 7 Sep 2018 20:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726010AbeIHAvf (ORCPT ); Fri, 7 Sep 2018 20:51:35 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:34242 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbeIHAvf (ORCPT ); Fri, 7 Sep 2018 20:51:35 -0400 Received: by mail-pl1-f195.google.com with SMTP id f6-v6so7065469plo.1 for ; Fri, 07 Sep 2018 13:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieahl-im.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=U+LCn+tGBn4g91J27ahpHZnhw99Dn7tqV0Pc4odJTh4=; b=bXpU9raRdbHUVoPJAeoRx9Dw1KRzlszzkRAFdaa9Tv3lSTzFU/8vMyWt6oATgvBDHE VwEpI9y8pywN9Mj28bDGAlAVYQZTNICebHrNH+eLzViTaawalIiEGBdqpQCexOJ+IOns cztqnzALnqiOcd3XoXIO2F7uPCMCj95UirkR29TZiYu+3qZrZOu6t1ANa63FFSlMJdyZ dSuUNmEpgFJmxyJl0ra3PhABRf8eUG9tI9F/9imYiP5+qlcciaP5eV5VsoW7bltzOCYi CBh116n/EFxBgfKr4H6Q0dN9l/3VmglRd5NFu/C8Tilt+v1vNEgBirlEnQfKzOElnTGY pcCg== 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=U+LCn+tGBn4g91J27ahpHZnhw99Dn7tqV0Pc4odJTh4=; b=RoTMTkReX8FiDsOIL9pvm+lEn6FkizlI4yC/+ux1oIe8/HByC/zKZ6KE8Q5q0JZn1K zpWE0SZCOxLgmaQafwd5y0hb9O6bWcdel9oDdvttIyqf0xiBN2J04U9++hQVGH3lv2t6 oKs3IYJsfUk61VpBI8wG8w5igSDPzd6u5odZJfgjKO+n3d6eHrm+PD0ASiq+AFG+R499 FoTIP0OFFrpB2IIbI13Mf7s1emSdF/7IpOZkCJ0KFvc7kmHf5dmL/L3V3Umr8b+TJnrO /hMg9jSLp8PxHOg7w5ppTIIT8pXDuzo5tCSMipFzNdQe/0Rly+9YQiX7fQROaFe3C/7H TKFw== X-Gm-Message-State: APzg51A0Mih+Ck9stqCICkXkr2TLKFv7Ku0k6SIKrSmsua06Umh6YNgN cnWRknKOCpDiZ8nxApGFi2AToDMipdN8Gg== X-Google-Smtp-Source: ANB0VdYmuQR668j5OXA1VYCelDCyulsuUEXFjyTGMR+cldQAnUBd5TNcc3I7+FUJvShsjlzVgR0TeQ== X-Received: by 2002:a17:902:934c:: with SMTP id g12-v6mr9735265plp.67.1536350943635; Fri, 07 Sep 2018 13:09:03 -0700 (PDT) Received: from WorkZone.localdomain ([175.138.183.133]) by smtp.googlemail.com with ESMTPSA id o62-v6sm11266569pfb.0.2018.09.07.13.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 13:09:03 -0700 (PDT) From: Fieah Lim To: "Rafael J. Wysocki" , Daniel Lezcano , linux-kernel@vger.kernel.org (open list), linux-pm@vger.kernel.org (open list:CPUIDLE DRIVERS) Cc: Fieah Lim Subject: [PATCH] cpuidle: Remove unnecessary wrapper cpuidle_get_last_residency() Date: Sat, 8 Sep 2018 04:08:38 +0800 Message-Id: <20180907200838.4966-1-kw@fieahl.im> X-Mailer: git-send-email 2.18.0 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 There's no magic inside, let's just make it more intuitive. Signed-off-by: Fieah Lim --- drivers/cpuidle/governors/ladder.c | 2 +- drivers/cpuidle/governors/menu.c | 2 +- include/linux/cpuidle.h | 10 ---------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c index 704880a6612a..f0dddc66af26 100644 --- a/drivers/cpuidle/governors/ladder.c +++ b/drivers/cpuidle/governors/ladder.c @@ -80,7 +80,7 @@ static int ladder_select_state(struct cpuidle_driver *drv, last_state = &ldev->states[last_idx]; - last_residency = cpuidle_get_last_residency(dev) - drv->states[last_idx].exit_latency; + last_residency = dev->last_residency - drv->states[last_idx].exit_latency; /* consider promotion */ if (last_idx < drv->state_count - 1 && diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 1aef60d160eb..715520e339da 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -492,7 +492,7 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) measured_us = 9 * MAX_INTERESTING / 10; } else { /* measured value */ - measured_us = cpuidle_get_last_residency(dev); + measured_us = dev->last_residency; /* Deduct exit latency */ if (measured_us > 2 * target->exit_latency) diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 4325d6fdde9b..d262f620890e 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -99,16 +99,6 @@ struct cpuidle_device { DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); DECLARE_PER_CPU(struct cpuidle_device, cpuidle_dev); -/** - * cpuidle_get_last_residency - retrieves the last state's residency time - * @dev: the target CPU - */ -static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) -{ - return dev->last_residency; -} - - /**************************** * CPUIDLE DRIVER INTERFACE * ****************************/