mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dawson Engler <engler@csl.Stanford.EDU>
To: linux-kernel@vger.kernel.org
Cc: mc@cs.Stanford.EDU
Subject: [CHECKER] new floating point bugs in 2.4.5-ac4
Date: Wed, 30 May 2001 13:33:57 -0700 (PDT)	[thread overview]
Message-ID: <200105302033.NAA07866@csl.Stanford.EDU> (raw)

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

             reply	other threads:[~2001-05-30 20:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-30 20:33 Dawson Engler [this message]
2001-05-30 20:48 ` arjan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200105302033.NAA07866@csl.Stanford.EDU \
    --to=engler@csl.stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.Stanford.EDU \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®