From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 10 Feb 2003 16:57:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 10 Feb 2003 16:57:15 -0500 Received: from tmr-02.dsl.thebiz.net ([216.238.38.204]:52751 "EHLO gatekeeper.tmr.com") by vger.kernel.org with ESMTP id ; Mon, 10 Feb 2003 16:57:15 -0500 Date: Mon, 10 Feb 2003 17:03:25 -0500 (EST) From: Bill Davidsen To: "Richard B. Johnson" cc: Linux Kernel Mailing List Subject: Re: [PATCH] 2.5.59 : sound/oss/vidc.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 Feb 2003, Richard B. Johnson wrote: > If the code is correct, it really should be written as: > > 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. Power of two - yes. Greater than 128 no, if newsize were <=128 new2size would not increment. Previous code may make newsize larger (and later limit new2size) but not here. And new2size can be equal to newsize, again by this code. A comment like /*empty_loop*/ before the semicolon would help human readability. Code should be readable by humans, too. -- bill davidsen CTO, TMR Associates, Inc Doing interesting things with little computers since 1979.