Date: Wed, 23 May 2018 15:27:43 -0700 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Matt Macy <mmacy@FreeBSD.org> 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> In-Reply-To: <201805190510.w4J5AqfS054367@repo.freebsd.org> References: <201805190510.w4J5AqfS054367@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180523222743.GU71675>