From owner-freebsd-current@FreeBSD.ORG Mon Jul 1 13:11:34 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FACB441 for ; Mon, 1 Jul 2013 13:11:34 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-qe0-x232.google.com (mail-qe0-x232.google.com [IPv6:2607:f8b0:400d:c02::232]) by mx1.freebsd.org (Postfix) with ESMTP id DB13B1AF4 for ; Mon, 1 Jul 2013 13:11:33 +0000 (UTC) Received: by mail-qe0-f50.google.com with SMTP id f6so1660133qej.37 for ; Mon, 01 Jul 2013 06:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gmNBVdOYi6oONasYnzyZpaXUeGqSnB4ZIDbTo3FgbSg=; b=sVEV+Gm+eYPLmGInldxxp0r/YHXiAR7guGWWXCnv5jhxgXYzWZQ9JJmuqf/VC15OdC kJTABRYUAcBKWIadeOrp9g8jYF9Yi36/3mAKK1Xg0Y9oPPwj6rs/fiE0MoCpu3THKfxc HFvaDmWgo6fGxlO0DUnWZ/OEMTjzXZGxGpfqiVAluCRp+AojDhcD/4mvUmdIsYbszCyu aHfmFNBkM3XBytM5GESlInW36EPlrSTPhqvmCeFWdpLPZOFU+Xm8vxNWc73SAugEWUMb 9BKfnLbGI86jAlK8B3WV8TiF2nkgbJxYzZGOxCErCc/IcVGRZLYZwPe25/mSw03k1nfA Kp9A== MIME-Version: 1.0 X-Received: by 10.224.40.129 with SMTP id k1mr32659861qae.28.1372684293317; Mon, 01 Jul 2013 06:11:33 -0700 (PDT) Received: by 10.49.73.194 with HTTP; Mon, 1 Jul 2013 06:11:33 -0700 (PDT) Date: Mon, 1 Jul 2013 15:11:33 +0200 Message-ID: Subject: too many warnigns for variable 'cons_next_next' From: Svatopluk Kraus To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2013 13:11:34 -0000 Hi, could somebody help me, please, with too many following warnings: sys/buf_ring.h:189:33: warning: variable 'cons_next_next' set but not used As the warning is produced by header which is included a lot, the important warnings are visible poorly among them. I think that buf_ring_dequeue_sc() in sys/buf_ring.h could be change to suppress the warning this way: static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next, cons_next_next; + uint32_t cons_head, cons_next, cons_next_next __unused; uint32_t prod_tail; void *buf; cons_head = br->br_cons_head; prod_tail = br->br_prod_tail; + if (cons_head == prod_tail) + return (NULL); cons_next = (cons_head + 1) & br->br_cons_mask; - cons_next_next = (cons_head + 2) & br->br_cons_mask; - if (cons_head == prod_tail) - return (NULL); #ifdef PREFETCH_DEFINED + cons_next_next = (cons_head + 2) & br->br_cons_mask; if (cons_next != prod_tail) { prefetch(br->br_ring[cons_next]); if (cons_next_next != prod_tail) prefetch(br->br_ring[cons_next_next]); } #endif Thanks for any respond, Svata