From bd775e4adbfdd95bde42e9a872356ec89ac52d34 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 21 Oct 2020 14:02:01 +0200 Subject: [PATCH] cosmetic: Fix whitespace (use tab instead of 8x space) Change-Id: I2b8d80fb771336d4d2c4a9ea1749935bdf14a37b --- src/datagram.c | 12 ++++++------ src/rs232.c | 20 ++++++++++---------- src/stream.c | 44 ++++++++++++++++++++++---------------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/datagram.c b/src/datagram.c index 4bc7bed..8b68244 100644 --- a/src/datagram.c +++ b/src/datagram.c @@ -119,7 +119,7 @@ static int osmo_dgram_tx_fd_cb(struct osmo_fd *ofd, unsigned int what) LOGP(DLINP, LOGL_DEBUG, "write\n"); osmo_dgram_tx_write(conn); } - return 0; + return 0; } /*! \brief Create an Osmocom datagram transmitter @@ -246,12 +246,12 @@ void osmo_dgram_tx_send(struct osmo_dgram_tx *conn, #define OSMO_DGRAM_RX_F_RECONF (1 << 0) struct osmo_dgram_rx { - struct osmo_fd ofd; - char *addr; - uint16_t port; + struct osmo_fd ofd; + char *addr; + uint16_t port; int (*cb)(struct osmo_dgram_rx *conn); - void *data; - unsigned int flags; + void *data; + unsigned int flags; }; /*! \brief Receive data via Osmocom datagram receiver diff --git a/src/rs232.c b/src/rs232.c index 8ee658a..865ec97 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -72,15 +72,15 @@ static int handle_ser_write(struct osmo_fd *bfd) struct msgb *msg; int written; - LOGP(DLINP, LOGL_DEBUG, "writing data to rs232\n"); + LOGP(DLINP, LOGL_DEBUG, "writing data to rs232\n"); - if (llist_empty(&r->tx_queue)) { - r->ofd.when &= ~OSMO_FD_WRITE; - return 0; - } - lh = r->tx_queue.next; - llist_del(lh); - msg = llist_entry(lh, struct msgb, list); + if (llist_empty(&r->tx_queue)) { + r->ofd.when &= ~OSMO_FD_WRITE; + return 0; + } + lh = r->tx_queue.next; + llist_del(lh); + msg = llist_entry(lh, struct msgb, list); written = write(bfd->fd, msg->data, msg->len); if (written < msg->len) { @@ -254,8 +254,8 @@ int osmo_rs232_read(struct osmo_rs232 *r, struct msgb *msg) void osmo_rs232_write(struct osmo_rs232 *r, struct msgb *msg) { - msgb_enqueue(&r->tx_queue, msg); - r->ofd.when |= OSMO_FD_WRITE; + msgb_enqueue(&r->tx_queue, msg); + r->ofd.when |= OSMO_FD_WRITE; } void osmo_rs232_close(struct osmo_rs232 *r) diff --git a/src/stream.c b/src/stream.c index 2bb3e75..3376126 100644 --- a/src/stream.c +++ b/src/stream.c @@ -221,15 +221,15 @@ static int setsockopt_nodelay(int fd, int proto, int on) */ enum osmo_stream_cli_state { - STREAM_CLI_STATE_CLOSED, /* No fd associated, no timer active */ - STREAM_CLI_STATE_WAIT_RECONNECT, /* No fd associated, has timer active to try to connect again */ - STREAM_CLI_STATE_CONNECTING, /* Fd associated, but connection not yet confirmed by peer or lower layers */ - STREAM_CLI_STATE_CONNECTED, /* Fd associated and connection is established */ - STREAM_CLI_STATE_MAX + STREAM_CLI_STATE_CLOSED, /* No fd associated, no timer active */ + STREAM_CLI_STATE_WAIT_RECONNECT, /* No fd associated, has timer active to try to connect again */ + STREAM_CLI_STATE_CONNECTING, /* Fd associated, but connection not yet confirmed by peer or lower layers */ + STREAM_CLI_STATE_CONNECTED, /* Fd associated and connection is established */ + STREAM_CLI_STATE_MAX }; static const struct value_string stream_cli_state_names[] = { - { STREAM_CLI_STATE_CLOSED, "CLOSED" }, + { STREAM_CLI_STATE_CLOSED, "CLOSED" }, { STREAM_CLI_STATE_WAIT_RECONNECT, "WAIT_RECONNECT" }, { STREAM_CLI_STATE_CONNECTING, "CONNECTING" }, { STREAM_CLI_STATE_CONNECTED, "CONNECTED" }, @@ -251,10 +251,10 @@ struct osmo_stream_cli { struct osmo_timer_list timer; enum osmo_stream_cli_state state; char *addr[OSMO_STREAM_MAX_ADDRS]; - uint8_t addrcnt; + uint8_t addrcnt; uint16_t port; char *local_addr[OSMO_STREAM_MAX_ADDRS]; - uint8_t local_addrcnt; + uint8_t local_addrcnt; uint16_t local_port; uint16_t proto; int (*connect_cb)(struct osmo_stream_cli *srv); @@ -422,7 +422,7 @@ static int osmo_stream_cli_fd_cb(struct osmo_fd *ofd, unsigned int what) /* Only CONNECTING and CONNECTED states are expected, since they are the only states where FD exists: */ osmo_panic("osmo_stream_cli_fd_cb called with unexpected state %d\n", cli->state); } - return 0; + return 0; } static void cli_timer_cb(void *data); @@ -823,14 +823,14 @@ int osmo_stream_cli_recv(struct osmo_stream_cli *cli, struct msgb *msg) #define OSMO_STREAM_SRV_F_NODELAY (1 << 1) struct osmo_stream_srv_link { - struct osmo_fd ofd; - char *addr[OSMO_STREAM_MAX_ADDRS]; - uint8_t addrcnt; - uint16_t port; - uint16_t proto; - int (*accept_cb)(struct osmo_stream_srv_link *srv, int fd); - void *data; - int flags; + struct osmo_fd ofd; + char *addr[OSMO_STREAM_MAX_ADDRS]; + uint8_t addrcnt; + uint16_t port; + uint16_t proto; + int (*accept_cb)(struct osmo_stream_srv_link *srv, int fd); + void *data; + int flags; }; static int osmo_stream_srv_fd_cb(struct osmo_fd *ofd, unsigned int what) @@ -1100,11 +1100,11 @@ void osmo_stream_srv_link_close(struct osmo_stream_srv_link *link) struct osmo_stream_srv { struct osmo_stream_srv_link *srv; - struct osmo_fd ofd; - struct llist_head tx_queue; - int (*closed_cb)(struct osmo_stream_srv *peer); - int (*cb)(struct osmo_stream_srv *peer); - void *data; + struct osmo_fd ofd; + struct llist_head tx_queue; + int (*closed_cb)(struct osmo_stream_srv *peer); + int (*cb)(struct osmo_stream_srv *peer); + void *data; int flags; };