linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Bradford <john@grabjohn.com>
To: jamagallon@able.es (J.A. Magallon)
Cc: root@chaos.analogic.com, rmk@arm.linux.org.uk, fdavis@si.rr.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.59 : sound/oss/vidc.c
Date: Fri, 7 Feb 2003 22:35:39 +0000 (GMT)	[thread overview]
Message-ID: <200302072235.h17MZduS003137@darkstar.example.net> (raw)
In-Reply-To: <20030207215817.GA2092@werewolf.able.es> from "J.A. Magallon" at Feb 07, 2003 10:58:17 PM

> >    for (new2size = 128; new2size < newsize; new2size <<= 1)
> >        ;
> > 
> > The code seems to want to make the value of new2size a power of
> > 2 and, greater than 128, but less than newsize. It ignores the
> > fact that newsize might be less than 128, maybe this is okay.
> > But, the code goes on, eventually settling on new2size being
> > less than 4096... hmmm. I'll bet this could be greatly
> > simplified. I think 'new2size' is really something that will
> > fit inside 128-byte groups. Maybe an & or a % will greatly
> > simplify?
> > 
> 
> Isn't just a ffs or the like ?

I'm just wondering whether

if (newsize > 4096) newsize = 4096;

can be removed, because:

hwrate is verified to be between 3 and 255, so 10000/hwrate will be

39 < hwrate < 3333

and ignoring the lower two bits, (& ~3),

36 < hwrate < 3332

so:

for (new2size = 128; new2size < newsize; new2size <<= 1) ;

will never cause new2size to evaluate to more than 4096 anyway.

(as far as I can see).

John.

  parent reply	other threads:[~2003-02-07 22:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-07 17:13 [PATCH] 2.5.59 : sound/oss/vidc.c Frank Davis
2003-02-07 19:43 ` Russell King
2003-02-07 20:03   ` John Bradford
2003-02-07 20:47     ` Richard B. Johnson
2003-02-07 21:58       ` J.A. Magallon
2003-02-07 22:20         ` Russell King
2003-02-07 22:35         ` John Bradford [this message]
2003-02-10 22:03       ` Bill Davidsen
2003-02-11  7:49         ` Horst von Brand
2003-02-07 23:54 ` Alan Cox
2003-02-10  0:23 ` Rusty Russell
2003-02-08  0:37 Alexei Podtelezhnikov

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=200302072235.h17MZduS003137@darkstar.example.net \
    --to=john@grabjohn.com \
    --cc=fdavis@si.rr.com \
    --cc=jamagallon@able.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    --cc=root@chaos.analogic.com \
    /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;
as well as URLs for NNTP newsgroup(s).