Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262834AbVEHJtY (ORCPT ); Sun, 8 May 2005 05:49:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262835AbVEHJtH (ORCPT ); Sun, 8 May 2005 05:49:07 -0400 Received: from hobbit.corpit.ru ([81.13.94.6]:55388 "EHLO hobbit.corpit.ru") by vger.kernel.org with ESMTP id S262834AbVEHJs7 (ORCPT ); Sun, 8 May 2005 05:48:59 -0400 Message-ID: <427DE086.40307@tls.msk.ru> Date: Sun, 08 May 2005 13:48:54 +0400 From: Michael Tokarev Organization: Telecom Service, JSC User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Glanzmann Cc: LKML , GIT Subject: Re: [PATCH] Really *do* nothing in while loop References: <20050508093440.GA9873@cip.informatik.uni-erlangen.de> In-Reply-To: <20050508093440.GA9873@cip.informatik.uni-erlangen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1142 Lines: 35 Thomas Glanzmann wrote: > [PATCH] Really *do* nothing in while loop > > Signed-Off-by: Thomas Glanzmann > > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -335,7 +335,7 @@ > stream.next_in = hdr; > stream.avail_in = hdrlen; > while (deflate(&stream, 0) == Z_OK) > - /* nothing */ > + /* nothing */; > > /* Then the data itself.. */ > stream.next_in = buf; Well, the lack of semicolon is wrong really (and funny). But is the whole while loop needed at all? deflate() consumes as much input as it can, producing as much output as it can. So without the loop, and without updating the buffer pointers ({next,avail}_{in,out}) it will do just fine without the loop, and will return something != Z_OK on next iteration. If this is to mean to flush output, it should be deflate(&stream, Z_FLUSH) or something. /mjt P.S. What's git@vger.kernel.org for ? - 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/