From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752430AbeDJIAD (ORCPT ); Tue, 10 Apr 2018 04:00:03 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:35750 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbeDJIAC (ORCPT ); Tue, 10 Apr 2018 04:00:02 -0400 X-Google-Smtp-Source: AIpwx4/2GRBA3nSKzyi8laK5TYMfcqwDJ/p2coaOSTXSl1eO3uNRDkWskunrkicySUW3DbxXeP5qH+Oi0lu402kSDZI= MIME-Version: 1.0 In-Reply-To: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> References: <891d4f632fbff5052e11f2d0b6fac35d@codeaurora.org> From: "Rafael J. Wysocki" Date: Tue, 10 Apr 2018 10:00:01 +0200 X-Google-Sender-Auth: b9ciASoCtUd7BuJ6c9PMwYuKnzY Message-ID: Subject: Re: Subject: [PATCH] [PATCH] time: tick-sched: use bool for tick_stopped To: yuankuiz@codeaurora.org Cc: Linux PM , "Rafael J. Wysocki" , Frederic Weisbecker , Peter Zijlstra , Thomas Gleixner , aulmck@linux.vnet.ibm.com, Ingo Molnar , Len Brown , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 9:33 AM, wrote: > From: John Zhao > > Variable tick_stopped returned by tick_nohz_tick_stopped > can have only true / forse values. Since the return type > of the tick_nohz_tick_stopped is also bool, variable > tick_stopped nice to have data type as bool in place of int. > Moreover, the executed instructions cost could be minimal > without potiential data type conversion. > > Signed-off-by: John Zhao > --- > kernel/time/tick-sched.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h > index 6de959a..4d34309 100644 > --- a/kernel/time/tick-sched.h > +++ b/kernel/time/tick-sched.h > @@ -48,8 +48,8 @@ struct tick_sched { > unsigned long check_clocks; > enum tick_nohz_mode nohz_mode; > > + bool tick_stopped : 1; > unsigned int inidle : 1; > - unsigned int tick_stopped : 1; > unsigned int idle_active : 1; > unsigned int do_timer_last : 1; > unsigned int got_idle_tick : 1; I don't think this is a good idea at all. Please see https://lkml.org/lkml/2017/11/21/384 for example. Thanks!