From owner-freebsd-hackers Fri Jul 6 7:35:57 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 23B1137B403 for ; Fri, 6 Jul 2001 07:35:53 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 924 invoked by uid 1000); 6 Jul 2001 14:40:19 -0000 Date: Fri, 6 Jul 2001 17:40:19 +0300 From: Peter Pentchev To: Evan Sarmiento Cc: freebsd-hackers@freebsd.org Subject: Re: LIST_NEXT() Message-ID: <20010706174019.B700@ringworld.oblivion.bg> Mail-Followup-To: Evan Sarmiento , freebsd-hackers@freebsd.org References: <200107061348.JAA26189@mail1.javanet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200107061348.JAA26189@mail1.javanet.com>; from kaworu@sektor7.ath.cx on Fri, Jul 06, 2001 at 09:48:26AM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jul 06, 2001 at 09:48:26AM -0400, Evan Sarmiento wrote: > Hello, > > I'm writing a kernel module, and it involves traversing the proc list searching for the right structure, > however, when I use SLIST_NEXT(p, p_list) in the program, I get a warning when I compile it: > > warning: statement with mo effect > > What am I doing wrong? I've read the manpages on queue and looked at the proc structure. > > Here's the code: > int > prfw_setflags(p, uap) > struct proc *p; > struct prfw_setflags_args *uap; > { > ... > if (uap->id) { > while (uap->id != p->p_pid) > LIST_NEXT(p, p_list); > } Well, first, you're using LIST_NEXT(), not SLIST_NEXT() :) Second, none of the *_NEXT() queue.h macros modify their parameters; they just return a pointer to the next element. So, just try: p = LIST_NEXT(p, p_list); ..and you'll be just fine. G'luck, Peter -- If I were you, who would be reading this sentence? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message