From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [RFC PATCH 6/6] hwmon: OMAP4: On die temperature sensor driver Date: Thu, 11 Aug 2011 09:38:22 -0700 Message-ID: <1313080702.2214.69.camel@groeck-laptop> References: <1312979122-5896-1-git-send-email-j-keerthy@ti.com> <1312979122-5896-7-git-send-email-j-keerthy@ti.com> <20110810124629.GJ12882@legolas.emea.dhcp.ti.com> <20110811103658.GG27742@legolas.emea.dhcp.ti.com> Reply-To: guenter.roeck@ericsson.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: "J, KEERTHY" Cc: Russell King , "b-cousson@ti.com" , Tony Lindgren , "rnayak@ti.com" , "balbi@ti.com" , "lm-sensors@lm-sensors.org" , "khali@linux-fr.org" , "vishwanath.bs@ti.com" , "linux-omap@vger.kernel.org" , Linux ARM Kernel Mailing List List-Id: linux-omap@vger.kernel.org On Thu, 2011-08-11 at 09:00 -0400, J, KEERTHY wrote: > On Thu, Aug 11, 2011 at 4:06 PM, Felipe Balbi wrote: [ ... ] > >> >> + temp = omap_temp_sensor_readl(temp_sensor, > >> >> + temp_sensor->registers->bgap_counter); > >> >> + temp = (temp & temp_sensor->registers->counter_mask) >> > >> >> + __ffs(temp_sensor->registers->counter_mask); > >> > > >> > temp &= ?? > >> > > >> >> + temp = temp * 1000 / (temp_sensor->clk_rate); > >> > > >> > temp *= ?? > >> > >> Need to multiply the temp with 1000 before dividing. > >> temp *= evaluates the RHS first and then multiplies LHS. > > > > temp *= 1000; > > temp /= clk_rate; > > > > Different coding style. I preferred to do it in a single line. > Me too. Guenter From mboxrd@z Thu Jan 1 00:00:00 1970 From: guenter.roeck@ericsson.com (Guenter Roeck) Date: Thu, 11 Aug 2011 09:38:22 -0700 Subject: [RFC PATCH 6/6] hwmon: OMAP4: On die temperature sensor driver In-Reply-To: References: <1312979122-5896-1-git-send-email-j-keerthy@ti.com> <1312979122-5896-7-git-send-email-j-keerthy@ti.com> <20110810124629.GJ12882@legolas.emea.dhcp.ti.com> <20110811103658.GG27742@legolas.emea.dhcp.ti.com> Message-ID: <1313080702.2214.69.camel@groeck-laptop> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, 2011-08-11 at 09:00 -0400, J, KEERTHY wrote: > On Thu, Aug 11, 2011 at 4:06 PM, Felipe Balbi wrote: [ ... ] > >> >> + temp = omap_temp_sensor_readl(temp_sensor, > >> >> + temp_sensor->registers->bgap_counter); > >> >> + temp = (temp & temp_sensor->registers->counter_mask) >> > >> >> + __ffs(temp_sensor->registers->counter_mask); > >> > > >> > temp &= ?? > >> > > >> >> + temp = temp * 1000 / (temp_sensor->clk_rate); > >> > > >> > temp *= ?? > >> > >> Need to multiply the temp with 1000 before dividing. > >> temp *= evaluates the RHS first and then multiplies LHS. > > > > temp *= 1000; > > temp /= clk_rate; > > > > Different coding style. I preferred to do it in a single line. > Me too. Guenter From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Date: Thu, 11 Aug 2011 16:38:22 +0000 Subject: Re: [lm-sensors] [RFC PATCH 6/6] hwmon: OMAP4: On die temperature Message-Id: <1313080702.2214.69.camel@groeck-laptop> List-Id: References: <1312979122-5896-1-git-send-email-j-keerthy@ti.com> <1312979122-5896-7-git-send-email-j-keerthy@ti.com> <20110810124629.GJ12882@legolas.emea.dhcp.ti.com> <20110811103658.GG27742@legolas.emea.dhcp.ti.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "J, KEERTHY" Cc: Russell King , "b-cousson@ti.com" , Tony Lindgren , "rnayak@ti.com" , "balbi@ti.com" , "lm-sensors@lm-sensors.org" , "khali@linux-fr.org" , "vishwanath.bs@ti.com" , "linux-omap@vger.kernel.org" , Linux ARM Kernel Mailing List On Thu, 2011-08-11 at 09:00 -0400, J, KEERTHY wrote: > On Thu, Aug 11, 2011 at 4:06 PM, Felipe Balbi wrote: [ ... ] > >> >> + temp = omap_temp_sensor_readl(temp_sensor, > >> >> + temp_sensor->registers->bgap_counter); > >> >> + temp = (temp & temp_sensor->registers->counter_mask) >> > >> >> + __ffs(temp_sensor->registers->counter_mask); > >> > > >> > temp &= ?? > >> > > >> >> + temp = temp * 1000 / (temp_sensor->clk_rate); > >> > > >> > temp *= ?? > >> > >> Need to multiply the temp with 1000 before dividing. > >> temp *= evaluates the RHS first and then multiplies LHS. > > > > temp *= 1000; > > temp /= clk_rate; > > > > Different coding style. I preferred to do it in a single line. > Me too. Guenter _______________________________________________ lm-sensors mailing list lm-sensors@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/lm-sensors