From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbbC0TIB (ORCPT ); Fri, 27 Mar 2015 15:08:01 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:40564 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbbC0TH7 (ORCPT ); Fri, 27 Mar 2015 15:07:59 -0400 Date: Fri, 27 Mar 2015 20:07:50 +0100 From: Sascha Hauer To: Punit Agrawal Cc: linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin , 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 01/13] thermal: Make temperatures consistently unsigned long Message-ID: <20150327190750.GZ9742@pengutronix.de> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> <1427385240-6086-2-git-send-email-s.hauer@pengutronix.de> <9hhzj6y217d.fsf@e105922-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9hhzj6y217d.fsf@e105922-lin.cambridge.arm.com> 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: 19:49:52 up 11 days, 6:41, 47 users, load average: 0.01, 0.09, 0.13 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 Fri, Mar 27, 2015 at 10:18:14AM +0000, Punit Agrawal wrote: > Hi Sascha, > > Sascha Hauer writes: > > > The thermal framework uses int, long and unsigned long for temperatures > > in millicelsius. The majority of functions uses unsigned long, so change > > the remaining functions to use this type aswell. > > > > Signed-off-by: Sascha Hauer > > I'd suggest changing to long instead. It would allow the use of the > thermal framework in environments where temperatures are below 0C - > quite easily reached in many parts of the world. I agree to use a signed type. I also found it not so nice that the thermal core does not support negative temperatures. I only chose unsigned long because the patch got smallest that way, but I already expected this answer ;) We could also use int instead of long. INT_MAX °mC is still enough for using a computer on the surface of the sun (Not for the center though) 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: Fri, 27 Mar 2015 20:07:50 +0100 Subject: [PATCH 01/13] thermal: Make temperatures consistently unsigned long In-Reply-To: <9hhzj6y217d.fsf@e105922-lin.cambridge.arm.com> References: <1427385240-6086-1-git-send-email-s.hauer@pengutronix.de> <1427385240-6086-2-git-send-email-s.hauer@pengutronix.de> <9hhzj6y217d.fsf@e105922-lin.cambridge.arm.com> Message-ID: <20150327190750.GZ9742@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Mar 27, 2015 at 10:18:14AM +0000, Punit Agrawal wrote: > Hi Sascha, > > Sascha Hauer writes: > > > The thermal framework uses int, long and unsigned long for temperatures > > in millicelsius. The majority of functions uses unsigned long, so change > > the remaining functions to use this type aswell. > > > > Signed-off-by: Sascha Hauer > > I'd suggest changing to long instead. It would allow the use of the > thermal framework in environments where temperatures are below 0C - > quite easily reached in many parts of the world. I agree to use a signed type. I also found it not so nice that the thermal core does not support negative temperatures. I only chose unsigned long because the patch got smallest that way, but I already expected this answer ;) We could also use int instead of long. INT_MAX ?mC is still enough for using a computer on the surface of the sun (Not for the center though) 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 |