From patchwork Wed Oct 5 07:33:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 77276 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2629582qgf; Wed, 5 Oct 2016 00:33:33 -0700 (PDT) X-Received: by 10.66.84.161 with SMTP id a1mr11088299paz.195.1475652813742; Wed, 05 Oct 2016 00:33:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l71si1354014pfb.252.2016.10.05.00.33.33; Wed, 05 Oct 2016 00:33:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754435AbcJEHda (ORCPT + 27 others); Wed, 5 Oct 2016 03:33:30 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35091 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbcJEHd2 (ORCPT ); Wed, 5 Oct 2016 03:33:28 -0400 Received: by mail-wm0-f54.google.com with SMTP id f193so211324231wmg.0 for ; Wed, 05 Oct 2016 00:33:28 -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=OwF1XZl7ZckMov9STWK5fSSIRO3/fY/q3nJIZdZX0aQ=; b=Zkf3wvtiPUkrwX9tkGCw94nM5VkPbvq7CyCTdz65jZtNKx/ExcWkumb5H/ymab9oZe asQXjt0h+RIjg2HMLFjzvuv4IPNYwLbzMINIijwLoPLAzhLeWGWMnirQ97qZSmMCmXjH fMbmCdh+T1enD8kUi6oJgv0C3yLNC0hJDTROg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OwF1XZl7ZckMov9STWK5fSSIRO3/fY/q3nJIZdZX0aQ=; b=S3Pe8DRFkvVL2RbJzQkbywt25j/Wpg8TpOYerENQ3sVw/QTQWbwfq2dmqaFEoFr9dd IHceZUY+diMcUtblenAmeSYHHceorMc43yEUKAGs8zJJ8kpmniDK8BXNPF+qU+Rv+hSD FPSTEClgp16lJlhaUN8iHbR2TQ89j41tpDM/EaOyGqxsb/Ikm/lh41lTNDWnpY5ZC1AJ tTgfPrW3qLaewJQi1Y6YRmn4dcx/BLo/HFCdgrPsNqwe+as6LzmTthP3dPP1tmYfQ/2x Tc3qliQI8Ps40jdfI8MJiEjSXX2IRW98FI5SIxBB2Ht3MdBsan96XWodmZpPUcl61Log Zieg== X-Gm-Message-State: AA6/9RkmJypAv619di2UbWl4HN83ybobF/Xg/c8e9AWih2CwUCOTCU70ZLx5aVD/nV/hDn03 X-Received: by 10.28.165.66 with SMTP id o63mr17760603wme.3.1475652807142; Wed, 05 Oct 2016 00:33:27 -0700 (PDT) Received: from localhost.localdomain (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.gmail.com with ESMTPSA id 142sm7922776wmh.12.2016.10.05.00.33.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Oct 2016 00:33:26 -0700 (PDT) From: Daniel Lezcano To: rjw@rjwysocki.net Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 1/2] cpuidle: governors: Remove remaining old module code Date: Wed, 5 Oct 2016 09:33:12 +0200 Message-Id: <1475652794-4486-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The governor's code use try_module_get() and put_module() to refcount the governor's module. But the governors are not compiled as module. The refcount does not prevent to switch the governor or unload a module as they aren't compiled as modules. So the code is pointless, removing it. Signed-off-by: Daniel Lezcano --- drivers/cpuidle/governor.c | 4 ---- drivers/cpuidle/governors/ladder.c | 2 -- drivers/cpuidle/governors/menu.c | 2 -- include/linux/cpuidle.h | 2 -- 4 files changed, 10 deletions(-) -- 1.9.1 diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c index fb9f511..4e78263 100644 --- a/drivers/cpuidle/governor.c +++ b/drivers/cpuidle/governor.c @@ -9,7 +9,6 @@ */ #include -#include #include #include "cpuidle.h" @@ -53,14 +52,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov) if (cpuidle_curr_governor) { list_for_each_entry(dev, &cpuidle_detected_devices, device_list) cpuidle_disable_device(dev); - module_put(cpuidle_curr_governor->owner); } cpuidle_curr_governor = gov; if (gov) { - if (!try_module_get(cpuidle_curr_governor->owner)) - return -EINVAL; list_for_each_entry(dev, &cpuidle_detected_devices, device_list) cpuidle_enable_device(dev); cpuidle_install_idle_handler(); diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c index 63bd5a4..fe8f089 100644 --- a/drivers/cpuidle/governors/ladder.c +++ b/drivers/cpuidle/governors/ladder.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -177,7 +176,6 @@ static struct cpuidle_governor ladder_governor = { .enable = ladder_enable_device, .select = ladder_select_state, .reflect = ladder_reflect, - .owner = THIS_MODULE, }; /** diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 03d38c2..d9b5b93 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -19,7 +19,6 @@ #include #include #include -#include /* * Please note when changing the tuning values: @@ -484,7 +483,6 @@ static struct cpuidle_governor menu_governor = { .enable = menu_enable_device, .select = menu_select, .reflect = menu_reflect, - .owner = THIS_MODULE, }; /** diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index bb31373..15deea4 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -235,8 +235,6 @@ struct cpuidle_governor { int (*select) (struct cpuidle_driver *drv, struct cpuidle_device *dev); void (*reflect) (struct cpuidle_device *dev, int index); - - struct module *owner; }; #ifdef CONFIG_CPU_IDLE