Cosmetic: use TAILQ_FOREACH(). Join lines.

This commit is contained in:
dyoung 2008-06-23 00:56:08 +00:00
parent 1d1021c331
commit c3da8a28e7

View File

@ -1,4 +1,4 @@
/* $NetBSD: pfil.c,v 1.25 2008/05/29 14:51:27 mrg Exp $ */
/* $NetBSD: pfil.c,v 1.26 2008/06/23 00:56:08 dyoung Exp $ */
/*
* Copyright (c) 1996 Matthew R. Green
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.25 2008/05/29 14:51:27 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.26 2008/06/23 00:56:08 dyoung Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -206,10 +206,8 @@ pfil_list_add(pfil_list_t *list,
/*
* First make sure the hook is not already there.
*/
for (pfh = TAILQ_FIRST(list); pfh != NULL;
pfh = TAILQ_NEXT(pfh, pfil_link)) {
if (pfh->pfil_func == func &&
pfh->pfil_arg == arg)
TAILQ_FOREACH(pfh, list, pfil_link) {
if (pfh->pfil_func == func && pfh->pfil_arg == arg)
return EEXIST;
}
@ -265,8 +263,7 @@ pfil_list_remove(pfil_list_t *list,
{
struct packet_filter_hook *pfh;
for (pfh = TAILQ_FIRST(list); pfh != NULL;
pfh = TAILQ_NEXT(pfh, pfil_link)) {
TAILQ_FOREACH(pfh, list, pfil_link) {
if (pfh->pfil_func == func && pfh->pfil_arg == arg) {
TAILQ_REMOVE(list, pfh, pfil_link);
free(pfh, M_IFADDR);