Simplify "LIST_HEAD();" to make the code more understandable.

No functional change.
This commit is contained in:
msaitoh 2019-06-25 12:30:50 +00:00
parent 316057bc1a
commit b801416bbd
5 changed files with 15 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gif.c,v 1.147 2019/06/18 07:50:43 msaitoh Exp $ */ /* $NetBSD: if_gif.c,v 1.148 2019/06/25 12:30:50 msaitoh Exp $ */
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
/* /*
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.147 2019/06/18 07:50:43 msaitoh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.148 2019/06/25 12:30:50 msaitoh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -97,9 +97,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.147 2019/06/18 07:50:43 msaitoh Exp $")
/* /*
* gif global variable definitions * gif global variable definitions
*/ */
LIST_HEAD(gif_sclist, gif_softc);
static struct { static struct {
struct gif_sclist list; LIST_HEAD(gif_sclist, gif_softc) list;
kmutex_t lock; kmutex_t lock;
} gif_softcs __cacheline_aligned; } gif_softcs __cacheline_aligned;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ipsec.c,v 1.21 2019/03/14 03:52:40 knakahara Exp $ */ /* $NetBSD: if_ipsec.c,v 1.22 2019/06/25 12:30:50 msaitoh Exp $ */
/* /*
* Copyright (c) 2017 Internet Initiative Japan Inc. * Copyright (c) 2017 Internet Initiative Japan Inc.
@ -27,7 +27,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.21 2019/03/14 03:52:40 knakahara Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.22 2019/06/25 12:30:50 msaitoh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -139,9 +139,8 @@ static int if_ipsec_set_addr_port(struct sockaddr *, struct sockaddr *,
*/ */
/* This list is used in ioctl context only. */ /* This list is used in ioctl context only. */
LIST_HEAD(ipsec_sclist, ipsec_softc);
static struct { static struct {
struct ipsec_sclist list; LIST_HEAD(ipsec_sclist, ipsec_softc) list;
kmutex_t lock; kmutex_t lock;
} ipsec_softcs __cacheline_aligned; } ipsec_softcs __cacheline_aligned;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_l2tp.c,v 1.34 2019/04/26 11:51:56 pgoyette Exp $ */ /* $NetBSD: if_l2tp.c,v 1.35 2019/06/25 12:30:50 msaitoh Exp $ */
/* /*
* Copyright (c) 2017 Internet Initiative Japan Inc. * Copyright (c) 2017 Internet Initiative Japan Inc.
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.34 2019/04/26 11:51:56 pgoyette Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.35 2019/06/25 12:30:50 msaitoh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -95,9 +95,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.34 2019/04/26 11:51:56 pgoyette Exp $"
/* /*
* l2tp global variable definitions * l2tp global variable definitions
*/ */
LIST_HEAD(l2tp_sclist, l2tp_softc);
static struct { static struct {
struct l2tp_sclist list; LIST_HEAD(l2tp_sclist, l2tp_softc) list;
kmutex_t lock; kmutex_t lock;
} l2tp_softcs __cacheline_aligned; } l2tp_softcs __cacheline_aligned;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ppp.c,v 1.164 2019/01/25 08:51:29 knakahara Exp $ */ /* $NetBSD: if_ppp.c,v 1.165 2019/06/25 12:30:50 msaitoh Exp $ */
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */ /* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
/* /*
@ -102,7 +102,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.164 2019/01/25 08:51:29 knakahara Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.165 2019/06/25 12:30:50 msaitoh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "ppp.h" #include "ppp.h"
@ -206,9 +206,8 @@ static int ppp_clone_destroy(struct ifnet *);
static struct ppp_softc *ppp_create(const char *, int); static struct ppp_softc *ppp_create(const char *, int);
LIST_HEAD(ppp_sclist, ppp_softc);
static struct { static struct {
struct ppp_sclist list; LIST_HEAD(ppp_sclist, ppp_softc) list;
kmutex_t lock; kmutex_t lock;
} ppp_softcs __cacheline_aligned; } ppp_softcs __cacheline_aligned;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vlan.c,v 1.137 2019/06/18 08:36:52 msaitoh Exp $ */ /* $NetBSD: if_vlan.c,v 1.138 2019/06/25 12:30:50 msaitoh Exp $ */
/* /*
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.137 2019/06/18 08:36:52 msaitoh Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.138 2019/06/25 12:30:50 msaitoh Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_inet.h" #include "opt_inet.h"
@ -215,10 +215,9 @@ static void vlan_linkmib_update(struct ifvlan *, struct ifvlan_linkmib *);
static struct ifvlan_linkmib* vlan_lookup_tag_psref(struct ifnet *, static struct ifvlan_linkmib* vlan_lookup_tag_psref(struct ifnet *,
uint16_t, struct psref *); uint16_t, struct psref *);
LIST_HEAD(vlan_ifvlist, ifvlan);
static struct { static struct {
kmutex_t lock; kmutex_t lock;
struct vlan_ifvlist list; LIST_HEAD(vlan_ifvlist, ifvlan) list;
} ifv_list __cacheline_aligned; } ifv_list __cacheline_aligned;