From owner-freebsd-current@FreeBSD.ORG Mon Jul 1 13:40:37 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2F4149B6 for ; Mon, 1 Jul 2013 13:40:37 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) by mx1.freebsd.org (Postfix) with ESMTP id BFB761C6A for ; Mon, 1 Jul 2013 13:40:36 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id e11so3774616wgh.30 for ; Mon, 01 Jul 2013 06:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dfM0VBHmDvAvI4lOMon0wpc6e+hzLIpOPNYgpyzsjs8=; b=jSKtHlx53BX2yH2hVb/do+3eYM+UopDMMKP2uZg71JeiE+BACHPfx7s6jrUtluw4Tx 80MN2buWZUH3OG4BX4Yj6FaeT4V/k+5E/aPtwTtwlU7vCFvUjpoRCCs7h26gQZqJro0A fgVgIPO7h0vzGtZdpT8U3GQvrdvjRp0whDgLCut6zSxgeLJ4dRk7qca3KcuLxsI7OUhK iKYnLL1F5sJZsAJs6uST49+Wv4vY0S8b23VPKSr0fvI58Tr9OGM9gHoQ+ZRiAFOR5mgy Qk+dEdBd663lmBvk8+8blBODLUT0lCeH9rCJfM+p6IJ7yixbAjyZfqK+s62IMYZHaBPJ 2HuA== MIME-Version: 1.0 X-Received: by 10.194.121.132 with SMTP id lk4mr20294391wjb.25.1372686035788; Mon, 01 Jul 2013 06:40:35 -0700 (PDT) Received: by 10.194.172.133 with HTTP; Mon, 1 Jul 2013 06:40:35 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Jul 2013 17:40:35 +0400 Message-ID: Subject: Re: too many warnigns for variable 'cons_next_next' From: Sergey Kandaurov To: Svatopluk Kraus Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org 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:40:37 -0000 On 1 July 2013 17:11, Svatopluk Kraus wrote: > 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 > Why not put its declaration under #ifdef as well? YMMV. -- wbr, pluknet