public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [CHECKER] new floating point bugs in 2.4.5-ac4
@ 2001-05-30 20:33 Dawson Engler
  2001-05-30 20:48 ` arjan
  0 siblings, 1 reply; 2+ messages in thread
From: Dawson Engler @ 2001-05-30 20:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: mc

Here are two new uses of floating point that popped up in the 2.4.5-ac4
kernel.  While the expressions that use FP are trivial, at least my
version of gcc does not calculate them at compile time.

As a bonus, two old, but still existing FP uses are also included.

Dawson
MC linux bug database: http://hands.stanford.edu/linux

############################################################
# New errors.
#
---------------------------------------------------------
[BUG] DMFE_TX_TIMEOUT is HZ * 1.5 which seems easy to fix.

/u2/engler/mc/oses/linux/2.4.5-ac4/drivers/net/dmfe.c:1112:dmfe_timer: ERROR:FLOAT: cannot use fp in kernel

	if ( db->tx_packet_cnt &&
		((jiffies - dev->trans_start) > DMFE_TX_KICK) ) {
		outl(0x1, dev->base_addr + DCR1);   /* Tx polling again */

		/* TX Timeout */

Error --->
		if ( (jiffies - dev->trans_start) > DMFE_TX_TIMEOUT ) {
---------------------------------------------------------
[BUG] DMFE_TX_KICK is (HZ * 0.5) which gcc does as floating point.  Fix is
	trivial: just divide by 2 instead.
/u2/engler/mc/oses/linux/2.4.5-ac4/drivers/net/dmfe.c:1108:dmfe_timer: ERROR:FLOAT: cannot use fp in kernel

	}
	db->interval_rx_cnt = 0;

	/* TX polling kick monitor */
	if ( db->tx_packet_cnt &&

Error --->
		((jiffies - dev->trans_start) > DMFE_TX_KICK) ) {

############################################################
# Existing, unfixed errors
#
---------------------------------------------------------
[BUG]
/u2/engler/mc/oses/linux/2.4.5-ac4/drivers/video/sgivwfb.c:731:sgivwfb_set_var: ERROR:FLOAT: cannot use fp in kernel

  var->green.msb_right = 0;
  var->blue.msb_right = 0;
  var->transp.msb_right = 0;

  /* set video timing information */

Error --->
  var->pixclock = (__u32)(1.0e+9/(float)timing->cfreq);
---------------------------------------------------------
[BUG]
/u2/engler/mc/oses/linux/2.4.5-ac4/drivers/video/sgivwfb.c:664:sgivwfb_set_var: ERROR:FLOAT: cannot use fp in kernel

    return -EINVAL;             /* Resolution to high */

  /* XXX FIXME - should try to pick best refresh rate */
  /* for now, pick closest dot-clock within 3MHz*/
#error "Floating point not allowed in kernel"  

Error --->
  req_dot = (int)((1.0e3/1.0e6) / (1.0e-12 * (float)var->pixclock));



############################################################
# Old fixed
#
[FIXED] sis_main.c:crtc_to_var:FLOAT: cannot use fp in kerne
/u2/engler/mc/oses/linux/2.4.4/drivers/video/sis/sis_main.c:588:crtc_to_var: ERROR:FLOAT: cannot use fp in kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [CHECKER] new floating point bugs in 2.4.5-ac4
  2001-05-30 20:33 [CHECKER] new floating point bugs in 2.4.5-ac4 Dawson Engler
@ 2001-05-30 20:48 ` arjan
  0 siblings, 0 replies; 2+ messages in thread
From: arjan @ 2001-05-30 20:48 UTC (permalink / raw)
  To: Dawson Engler; +Cc: linux-kernel

In article <200105302033.NAA07866@csl.Stanford.EDU> you wrote:
> Here are two new uses of floating point that popped up in the 2.4.5-ac4
> kernel.  While the expressions that use FP are trivial, at least my
> version of gcc does not calculate them at compile time.

> [BUG] DMFE_TX_KICK is (HZ * 0.5) which gcc does as floating point.  Fix is
>        trivial: just divide by 2 instead.

Fixed in 2.4.5-ac5 already

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-30 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-30 20:33 [CHECKER] new floating point bugs in 2.4.5-ac4 Dawson Engler
2001-05-30 20:48 ` arjan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox