From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755277AbbDNKqA (ORCPT ); Tue, 14 Apr 2015 06:46:00 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:50182 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932143AbbDNKoy (ORCPT ); Tue, 14 Apr 2015 06:44:54 -0400 Date: Tue, 14 Apr 2015 12:44:47 +0200 From: Sascha Hauer To: Eduardo Valentin Cc: linux-pm@vger.kernel.org, Zhang Rui , linux-kernel@vger.kernel.org, Stephen Warren , Mikko Perttunen , kernel@pengutronix.de, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 05/13] thermal: inline only once used function Message-ID: <20150414104447.GI4946@pengutronix.de> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> <1427385240-6086-6-git-send-email-s.hauer@pengutronix.de> <20150407022307.GE4648@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150407022307.GE4648@localhost.localdomain> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 12:37:22 up 28 days, 22:29, 77 users, load average: 0.49, 0.28, 0.19 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 06, 2015 at 07:23:08PM -0700, Eduardo Valentin wrote: > On Thu, Mar 26, 2015 at 04:53:52PM +0100, Sascha Hauer wrote: > > Inline update_temperature into its only caller to make the code > > more readable. > > I am not sure I understand how this is improving readability, can you > please elaborate? It improves readability because the reader does not have to lookup the definition of update_temperature but can instead just read through. The function name "update_temperature" does not give new information either, so I thought inlining the code is a good idea. Anyway, I can skip this patch if you want. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sascha Hauer Subject: Re: [PATCH 05/13] thermal: inline only once used function Date: Tue, 14 Apr 2015 12:44:47 +0200 Message-ID: <20150414104447.GI4946@pengutronix.de> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> <1427385240-6086-6-git-send-email-s.hauer@pengutronix.de> <20150407022307.GE4648@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20150407022307.GE4648-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+glpam-linux-mediatek=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Eduardo Valentin Cc: Stephen Warren , linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mikko Perttunen , linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, Zhang Rui , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-pm@vger.kernel.org On Mon, Apr 06, 2015 at 07:23:08PM -0700, Eduardo Valentin wrote: > On Thu, Mar 26, 2015 at 04:53:52PM +0100, Sascha Hauer wrote: > > Inline update_temperature into its only caller to make the code > > more readable. > > I am not sure I understand how this is improving readability, can you > please elaborate? It improves readability because the reader does not have to lookup the definition of update_temperature but can instead just read through. The function name "update_temperature" does not give new information either, so I thought inlining the code is a good idea. Anyway, I can skip this patch if you want. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 From: s.hauer@pengutronix.de (Sascha Hauer) Date: Tue, 14 Apr 2015 12:44:47 +0200 Subject: [PATCH 05/13] thermal: inline only once used function In-Reply-To: <20150407022307.GE4648@localhost.localdomain> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> <1427385240-6086-6-git-send-email-s.hauer@pengutronix.de> <20150407022307.GE4648@localhost.localdomain> Message-ID: <20150414104447.GI4946@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Apr 06, 2015 at 07:23:08PM -0700, Eduardo Valentin wrote: > On Thu, Mar 26, 2015 at 04:53:52PM +0100, Sascha Hauer wrote: > > Inline update_temperature into its only caller to make the code > > more readable. > > I am not sure I understand how this is improving readability, can you > please elaborate? It improves readability because the reader does not have to lookup the definition of update_temperature but can instead just read through. The function name "update_temperature" does not give new information either, so I thought inlining the code is a good idea. Anyway, I can skip this patch if you want. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |