From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754517AbbHCQXC (ORCPT ); Mon, 3 Aug 2015 12:23:02 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37535 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754434AbbHCQW6 (ORCPT ); Mon, 3 Aug 2015 12:22:58 -0400 Message-ID: <55BF955E.1030801@linaro.org> Date: Mon, 03 Aug 2015 18:22:54 +0200 From: Daniel Lezcano User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Xunlei Pang , linux-kernel@vger.kernel.org CC: "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Xunlei Pang Subject: Re: [PATCH] cpuidle/coupled: Init cpuidle_device::safe_state_index References: <1437654681-20893-1-git-send-email-xlpang@126.com> In-Reply-To: <1437654681-20893-1-git-send-email-xlpang@126.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/23/2015 02:31 PM, Xunlei Pang wrote: > From: Xunlei Pang > > cpuidle_device::safe_state_index need to be initialized before use, > so assign the driver's safe_state_index to it. > > Signed-off-by: Xunlei Pang > --- > drivers/cpuidle/cpuidle.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c > index e8e2775..ed5c8efe 100644 > --- a/drivers/cpuidle/cpuidle.c > +++ b/drivers/cpuidle/cpuidle.c > @@ -585,6 +585,8 @@ int cpuidle_register(struct cpuidle_driver *drv, > */ > if (coupled_cpus) > device->coupled_cpus = *coupled_cpus; > + > + device->safe_state_index = drv->safe_state_index; Hey, good catch. We are lucky the safe_state_index is always zero. I think we can simplify the code by removing the safe_state_index from the cpuidle_device structure and use the one in the cpuidle_driver structure in coupled.c -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog