mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: linux-net@vger.kernel.org
Subject: funny looking equation
Date: Wed, 11 Oct 2006 15:40:55 -0400	[thread overview]
Message-ID: <1160595655.5512.6.camel@localhost.localdomain> (raw)

I was just testing some of my parsing code on all the .c and .h files in
the Linux kernel, and I came up with this little equation:

from 2.6.18 drivers/atm/eni.c:1272


---
                        int div;

                        if (!*pcr) *pcr = eni_dev->tx_bw+reserved;
                        for (*pre = 3; *pre >= 0; (*pre)--)
                                if (TS_CLOCK/pre_div[*pre]/64 > -*pcr) break;
                        if (*pre < 3) (*pre)++; /* else fail later */
                        div = pre_div[*pre]*-*pcr;
                                    ^^^^^^^^^^^^^
    This could really do with some spaces and a couple of parenthesis.

                        DPRINTK("max div %d\n",div);
                        *res = (TS_CLOCK+div-1)/div-1;
---


Oh well, this isn't a bug.  Just something that someone might want to
clean up the next time they touch that code.

-- Steve



             reply	other threads:[~2006-10-11 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-11 19:40 Steven Rostedt [this message]
2006-10-11 19:48 ` Randy Dunlap

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=1160595655.5512.6.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    /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®