From: Masatake YAMATO Date: Sat, 4 Mar 2023 05:51:33 +0000 (+0900) Subject: lsfd: add a helper macro, foreach_endpoint X-Git-Tag: v2.40-rc1~458^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e62d5873342820f307353178cd976b37f03b215c;p=thirdparty%2Futil-linux.git lsfd: add a helper macro, foreach_endpoint Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd-fifo.c b/misc-utils/lsfd-fifo.c index fc5ba390cb..6880d8dd47 100644 --- a/misc-utils/lsfd-fifo.c +++ b/misc-utils/lsfd-fifo.c @@ -68,7 +68,7 @@ static bool fifo_fill_column(struct proc *proc __attribute__((__unused__)), case COL_ENDPOINTS: { struct fifo *this = (struct fifo *)file; struct list_head *e; - list_for_each_backwardly(e, &this->endpoint.ipc->endpoints) { + foreach_endpoint(e, this->endpoint) { char *estr; struct fifo *other = list_entry(e, struct fifo, endpoint.endpoints); if (this == other) diff --git a/misc-utils/lsfd.h b/misc-utils/lsfd.h index b0c3748bd1..c09a11a752 100644 --- a/misc-utils/lsfd.h +++ b/misc-utils/lsfd.h @@ -214,6 +214,7 @@ struct ipc *get_ipc(struct file *file); void add_ipc(struct ipc *ipc, unsigned int hash); void init_endpoint(struct ipc_endpoint *endpoint); void add_endpoint(struct ipc_endpoint *endpoint, struct ipc *ipc); +#define foreach_endpoint(E,ENDPOINT) list_for_each_backwardly(E, &((ENDPOINT).ipc->endpoints)) /* * Name managing