Date: Thu, 19 May 2016 17:54:14 +0000 (UTC) From: "Conrad E. Meyer" <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300223 - head/sys/vm Message-ID: <201605191754.u4JHsEjV050119@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Thu May 19 17:54:14 2016 New Revision: 300223 URL: https://svnweb.freebsd.org/changeset/base/300223 Log: vm/vm_page.h: Fix trivial '-Wpointer-sign' warning pq_vcnt, as a count of real things, has no business being negative. It is only ever initialized by a u_int counter. The warning came from the atomic_add_int() in vm_pagequeue_cnt_add(). Rectify the warning by changing the variable to u_int. No functional change. Suggested by: Clang 3.3 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu May 19 17:48:56 2016 (r300222) +++ head/sys/vm/vm_page.c Thu May 19 17:54:14 2016 (r300223) @@ -384,11 +384,11 @@ vm_page_domain_init(struct vm_domain *vm *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = &vm_cnt.v_inactive_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_name) = "vm active pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = + *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = &vm_cnt.v_active_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu May 19 17:48:56 2016 (r300222) +++ head/sys/vm/vm_page.h Thu May 19 17:54:14 2016 (r300223) @@ -215,7 +215,7 @@ struct vm_pagequeue { struct mtx pq_mutex; struct pglist pq_pl; int pq_cnt; - int * const pq_vcnt; + u_int * const pq_vcnt; const char * const pq_name; } __aligned(CACHE_LINE_SIZE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605191754.u4JHsEjV050119>