From patchwork Thu Mar 16 05:29:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95384 Delivered-To: patch@linaro.org Received: by 10.140.89.134 with SMTP id v6csp660849qgd; Wed, 15 Mar 2017 22:31:09 -0700 (PDT) X-Received: by 10.98.46.130 with SMTP id u124mr8132553pfu.204.1489642269757; Wed, 15 Mar 2017 22:31:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si2965884pfk.113.2017.03.15.22.31.09; Wed, 15 Mar 2017 22:31:09 -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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbdCPFbB (ORCPT + 25 others); Thu, 16 Mar 2017 01:31:01 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33066 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbdCPFa6 (ORCPT ); Thu, 16 Mar 2017 01:30:58 -0400 Received: by mail-pf0-f178.google.com with SMTP id w189so19008344pfb.0 for ; Wed, 15 Mar 2017 22:30: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:in-reply-to:references :in-reply-to:references; bh=dkL0TZqzCW2AOQ4TGC9HfU7Su82X/avgNwGi9Z+OtAw=; b=gBk7tQ2l3/emWYqDwnAmKGHALDGvl6aeXl4MMD3XIM3Q5e98r0rjsX+5o7B6uhWCZT YS9ukoyGqrRJr/aO7y8fuLjVt7EUMpSqJPXwhihGVb6Ac8Nvq9W8j11DQIn3MrstJVI5 AbbFwEiXMPeJZAm9s1frF0HzXyl55j3A5ajaM= 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:in-reply-to :references:in-reply-to:references; bh=dkL0TZqzCW2AOQ4TGC9HfU7Su82X/avgNwGi9Z+OtAw=; b=TUbbv9OnDggxYXPPsuwiFMueD/DSfnQL4/jOgPgpVEcH0kGlnHj/oyNzIsGx88r7ZU XxxPbz1F+HFZuoFUPS28Cy5Byt8gUxdhgqjuuDBQ7TDJQ8/n9Fi2G+PmcNwRPA2zIIBs b4tYiFzkUbqk0vKekosrTIQObnLu8duGxLUO5zySLPGIYK+7cruNIQ6kPnWaDAnFzJrp Da2PsLO93hdbI55l3/3YD1fkDx3zN4rdHolktf7SK2dV3HwgURGMW2U4oETeF4rNJP2A dRcgIW9vGwVg6l9+G3h8+ThmCfjrHWVMZk/H2cwWZLTqnvTQpdbY9iKoyAEdDCfw0eCD Qqwg== X-Gm-Message-State: AFeK/H04YY1WcFsPxgCM0/jW7HK+4/WyPTNT9cOVsxlFto0+SI/mfDTEUyxHaufs+f1h51hf X-Received: by 10.98.223.133 with SMTP id d5mr8209520pfl.222.1489642251725; Wed, 15 Mar 2017 22:30:51 -0700 (PDT) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id z189sm7491547pgb.3.2017.03.15.22.30.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 22:30:51 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Javi Merino , Zhang Rui , Eduardo Valentin , Amit Daniel Kachhap , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot Subject: [PATCH 17/17] thermal: cpu_cooling: Rearrange struct cpufreq_cooling_device Date: Thu, 16 Mar 2017 10:59:52 +0530 Message-Id: <57676b8e5f4e21ae1645b8cc2a2ddb5f059262bc.1489640000.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This shrinks the size of the structure on arm64 by 8 bytes by avoiding padding of 4 bytes at two places. Also add missing doc comment for freq_table Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.7.1.410.g6faf27b diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 768a95bcc392..f31c753ac08f 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -75,17 +75,18 @@ struct time_in_idle { * struct cpufreq_cooling_device - data for cooling device with cpufreq * @id: unique integer value corresponding to each cpufreq_cooling_device * registered. - * @cdev: thermal_cooling_device pointer to keep track of the - * registered cooling device. - * @policy: cpufreq policy. + * @last_load: load measured by the latest call to cpufreq_get_requested_power() * @cpufreq_state: integer value representing the current state of cpufreq * cooling devices. * @clipped_freq: integer value representing the absolute value of the clipped * frequency. * @max_level: maximum cooling level. One less than total number of valid * cpufreq frequencies. + * @freq_table: Freq table in descending order of frequencies + * @cdev: thermal_cooling_device pointer to keep track of the + * registered cooling device. + * @policy: cpufreq policy. * @node: list_head to link all cpufreq_cooling_device together. - * @last_load: load measured by the latest call to cpufreq_get_requested_power() * @idle_time: idle time stats * @plat_get_static_power: callback to calculate the static power * @@ -94,14 +95,14 @@ struct time_in_idle { */ struct cpufreq_cooling_device { int id; - struct thermal_cooling_device *cdev; - struct cpufreq_policy *policy; + u32 last_load; unsigned int cpufreq_state; unsigned int clipped_freq; unsigned int max_level; struct freq_table *freq_table; /* In descending order */ + struct thermal_cooling_device *cdev; + struct cpufreq_policy *policy; struct list_head node; - u32 last_load; struct time_in_idle *idle_time; get_static_t plat_get_static_power; };