Date: Fri, 6 Jul 2001 19:05:06 +0400 (MSD) From: "Eugene L. Vorokov" <vel@bugz.infotecs.ru> To: Evan Sarmiento <kaworu@sektor7.ath.cx> Cc: freebsd-hackers@freebsd.org Subject: Re: LIST_NEXT() Message-ID: <200107061505.f66F56P01143@bugz.infotecs.ru> In-Reply-To: <200107061348.JAA26189@mail1.javanet.com> "from Evan Sarmiento at Jul 6, 2001 09:48:26 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107061505.f66F56P01143>
