From owner-svn-src-all@freebsd.org Wed May 23 22:27:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AC49EEAB2C; Wed, 23 May 2018 22:27:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DF75882592; Wed, 23 May 2018 22:27:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w4NMRh1C085412 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 23 May 2018 15:27:43 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w4NMRhZQ085411; Wed, 23 May 2018 15:27:43 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 23 May 2018 15:27:43 -0700 From: Gleb Smirnoff To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333860 - head/sys/kern Message-ID: <20180523222743.GU71675@FreeBSD.org> References: <201805190510.w4J5AqfS054367@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805190510.w4J5AqfS054367@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 22:27:45 -0000 Hi, On Sat, May 19, 2018 at 05:10:52AM +0000, Matt Macy wrote: M> Author: mmacy M> Date: Sat May 19 05:10:51 2018 M> New Revision: 333860 M> URL: https://svnweb.freebsd.org/changeset/base/333860 M> M> Log: M> sendfile: annotate unused value and ensure that npages is actually initialized M> M> Modified: M> head/sys/kern/kern_sendfile.c M> M> Modified: head/sys/kern/kern_sendfile.c M> ============================================================================== M> --- head/sys/kern/kern_sendfile.c Sat May 19 05:09:10 2018 (r333859) M> +++ head/sys/kern/kern_sendfile.c Sat May 19 05:10:51 2018 (r333860) M> @@ -341,7 +341,7 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, o M> } M> M> for (int i = 0; i < npages;) { M> - int j, a, count, rv; M> + int j, a, count, rv __unused; M> M> /* Skip valid pages. */ M> if (vm_page_is_valid(pa[i], vmoff(i, off) & PAGE_MASK, M> @@ -688,6 +688,7 @@ retry_space: M> if (space == 0) { M> sfio = NULL; M> nios = 0; M> + npages = 0; M> goto prepend_header; M> } M> hdr_uio = NULL; This initialization is redundant and a compiler warning if exists is wrong. If we jump down to prepend_header with nios == 0, we won't ever use npages. -- Gleb Smirnoff