From owner-freebsd-hackers Fri Jul 6 7:51:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bugz.infotecs.ru (bugz.infotecs.ru [195.210.139.22]) by hub.freebsd.org (Postfix) with ESMTP id 586DE37B407 for ; Fri, 6 Jul 2001 07:51:30 -0700 (PDT) (envelope-from vel@bugz.infotecs.ru) Received: (from root@localhost) by bugz.infotecs.ru (8.11.1/8.11.1) id f66F56P01143; Fri, 6 Jul 2001 19:05:06 +0400 (MSD) (envelope-from vel) From: "Eugene L. Vorokov" Message-Id: <200107061505.f66F56P01143@bugz.infotecs.ru> Subject: Re: LIST_NEXT() In-Reply-To: <200107061348.JAA26189@mail1.javanet.com> "from Evan Sarmiento at Jul 6, 2001 09:48:26 am" To: Evan Sarmiento Date: Fri, 6 Jul 2001 19:05:06 +0400 (MSD) Cc: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 > 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); > } > > ... > } The proper way would be: p = LIST_NEXT(p, p_list); Regards, Eugene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message