Messages in this thread | | | From | John Bradford <> | Subject | Re: [PATCH] 2.5.59 : sound/oss/vidc.c | Date | Fri, 7 Feb 2003 22:35:39 +0000 (GMT) |
| |
> > 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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |