Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp691421pxf; Thu, 1 Apr 2021 11:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoM7SJ6ZdhTwjX4abScHozRXckDu76g+MqOvpqa79dM80DYzw+mMo7w0GsK9/a42gvGazv X-Received: by 2002:a17:906:354a:: with SMTP id s10mr10224691eja.21.1617300116949; Thu, 01 Apr 2021 11:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617300116; cv=none; d=google.com; s=arc-20160816; b=oObla73Q8gfZBZRLBVUVKahGwu/hdEyPwkjVuNG15J92+CaQl+Rlv7iaqVFI33rUrf bkNdvqhYGgvj1pPD1UK/jKZUyq2gMbuiAKgx63Cc2cOfsJYw7arBmPMfVdlBzFcVHnJH vNWE8Lsh5xyPN4n3eMqMLPaQoLNfsClHDXwoH6hSqD0f5yf693vUIOky2SfMOxqQiRF9 RGx07nQPPwjTn2ee5l6XFJhJJ7HBHPCMgOnTYL7cWFJGNEgLpievcCK5daiixnGS1IZ8 6OjXdEllZzXHtMbWE0NurKSA2WoVqfoDYfSsGHiWw6Ej0VbjJgF4uZBzlA2wUMR8/NMw 1FtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date; bh=AKbMUMuUDuLdXeEnPc0LV6059IkqPKFYq/kWtASmm/8=; b=Bfwc5VJkPJCA0fa9y5B1GIxCJfAd+Ix+MxvElRH4pik6d0ufQjX5t1a40sVT6J6hty GxiSuCiRjqfpKi4upkOT8FnDb1+xFS8PcEerVYXvIdITbdRLmxkIcNncBxXM6oKC1wYZ joO4h8biv7B2+8HIyGl7t4zZmvXQFCo0Obj0iiVpEYo0I/FIVwk8bRgZZlN1+3nZMtSL NUvdNGfZaOaiSfpon3ipJOPFioITYVrP9QxLnzd4uYJiBqHcD0PLviYjRVbbHYePRSpY /9rSBiS50spAEku/yIspKaiSnxX0bcDCRFNWiMJIvRdUkxn6z34ghuPvY6/p2iPbisRd LgJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si4999357edl.428.2021.04.01.11.01.34; Thu, 01 Apr 2021 11:01:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237329AbhDAR7y (ORCPT + 99 others); Thu, 1 Apr 2021 13:59:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:60662 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234906AbhDARni (ORCPT ); Thu, 1 Apr 2021 13:43:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2E8FFB242; Thu, 1 Apr 2021 15:18:53 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id AE3F8DA790; Thu, 1 Apr 2021 17:16:43 +0200 (CEST) Date: Thu, 1 Apr 2021 17:16:43 +0200 From: David Sterba To: Jiapeng Chong Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: Remove useless call "zlib_inflateEnd" Message-ID: <20210401151643.GW7604@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Jiapeng Chong , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <1617099421-58511-1-git-send-email-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617099421-58511-1-git-send-email-jiapeng.chong@linux.alibaba.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 06:17:01PM +0800, Jiapeng Chong wrote: > Fix the following whitescan warning: > > Calling "zlib_inflateEnd(&workspace->strm)" is only useful for its > return value, which is ignored. According to the zlib API documentation in include/linux/zlib.h 301 extern int zlib_deflateEnd (z_streamp strm); 302 /* 303 All dynamically allocated data structures for this stream are freed. 304 This function discards any unprocessed input and does not flush any 305 pending output. 306 307 deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the 308 stream state was inconsistent, Z_DATA_ERROR if the stream was freed 309 prematurely (some input or output was discarded). In the error case, 310 msg may be set but then points to a static string (which must not be 311 deallocated). 312 */ The first paragraph says it could free data, so the call needs to be there. The return value could have some meaning as it could point out to some inconsistency in zlib internal state but just deleting is IMO wrong.