From: Randy Dunlap <rdunlap@xenotime.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-net@vger.kernel.org
Subject: Re: funny looking equation
Date: Wed, 11 Oct 2006 12:48:28 -0700 [thread overview]
Message-ID: <20061011124828.46b287e2.rdunlap@xenotime.net> (raw)
In-Reply-To: <1160595655.5512.6.camel@localhost.localdomain>
On Wed, 11 Oct 2006 15:40:55 -0400 Steven Rostedt wrote:
> 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.
and break the if-lines into kernel style.
---
~Randy
prev parent reply other threads:[~2006-10-11 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 19:40 Steven Rostedt
2006-10-11 19:48 ` Randy Dunlap [this message]
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=20061011124828.46b287e2.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
--cc=rostedt@goodmis.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®