]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: add a helper macro, foreach_endpoint
authorMasatake YAMATO <yamato@redhat.com>
Sat, 4 Mar 2023 05:51:33 +0000 (14:51 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 18 May 2023 18:27:27 +0000 (03:27 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd-fifo.c
misc-utils/lsfd.h

index fc5ba390cbb9fce8bf44f9bf8a205b0705a4d155..6880d8dd47c2177b599dcd8c91f39f924f22adad 100644 (file)
@@ -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)
index b0c3748bd1e3a8e31e42ecfbe91a3892be06d268..c09a11a752c29fdd12bdb1fce91cee0deba714a2 100644 (file)
@@ -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