From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965975AbdIYUB1 (ORCPT ); Mon, 25 Sep 2017 16:01:27 -0400 Received: from smtprelay0172.hostedemail.com ([216.40.44.172]:56545 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965026AbdIYUB0 (ORCPT ); Mon, 25 Sep 2017 16:01:26 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3870:3872:5007:6261:7875:10004:10400:10450:10455:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12663:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:19904:19999:21080:21627:30045:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: ring90_6337910c2fb3b X-Filterd-Recvd-Size: 2024 Date: Mon, 25 Sep 2017 16:01:09 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: mingo@kernel.org, markus@trippelsdorf.de, tj@kernel.org, mcgrof@kernel.org, ebiederm@xmission.com, paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] sched: Consistent task-state printing Message-ID: <20170925160109.0086eccb@vmware.local.home> In-Reply-To: <20170925121116.927982688@infradead.org> References: <20170925120747.125098571@infradead.org> <20170925121116.927982688@infradead.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Sep 2017 14:07:48 +0200 Peter Zijlstra wrote: > +static inline char __task_state_to_char(unsigned int state) > +{ > + static const char state_char[] = "RSDTtXZ"; > + > + BUILD_BUG_ON(1 + ilog2(TASK_REPORT) != sizeof(state_char) - 2); > > - return state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?'; > + return state_char[state]; > +} > + > +static inline char task_state_to_char(struct task_struct *tsk) > +{ > + return __task_state_to_char(__get_task_state(tsk)); > } > So far I'm fine with the patch set, but I hate the non descriptive "__" prefix of __task_state_to_char(). Can we make this a bit more descriptive, because every time I see it in other patches, I go back to this patch to see if we are using the right function. What about something like: task_state_to_state_char(unsigned int state); task_to_state_char(struct task_struct *tsk); ? This way, the "__" wont keep making me think we used the wrong function. -- Steve