From 12d884633143d74286a1c5b57d5d4cb186ba7513 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 1 Aug 2017 04:22:59 +0200 Subject: treewide: Remove useless casts from bind() pointer argument. This is using the following semantic patch: @bind@ type T; expression A, C; struct sockaddr *B; @@ - bind(A, (struct sockaddr *) B, C) + bind(A, B, C) @bind_in@ type T; expression A, C; struct sockaddr_in *B; @@ - bind(A, (struct sockaddr *) B, C) + bind(A, B, C) Signed-off-by: Ralf Baechle --- tcpip/rip98d.c | 2 +- tcpip/ttylinkd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tcpip') diff --git a/tcpip/rip98d.c b/tcpip/rip98d.c index 70b92f1..50df60e 100644 --- a/tcpip/rip98d.c +++ b/tcpip/rip98d.c @@ -243,7 +243,7 @@ int main(int argc, char **argv) loc_addr.sin_addr.s_addr = htonl(INADDR_ANY); loc_addr.sin_port = htons(RIP_PORT); - if (bind(s, (struct sockaddr *)&loc_addr, sizeof(loc_addr)) < 0) { + if (bind(s, &loc_addr, sizeof(loc_addr)) < 0) { perror("rip98d: bind"); close(s); return 1; diff --git a/tcpip/ttylinkd.c b/tcpip/ttylinkd.c index f32499c..c530d73 100644 --- a/tcpip/ttylinkd.c +++ b/tcpip/ttylinkd.c @@ -308,7 +308,7 @@ int main(int argc, char *argv[]) exit(1); } - if (bind(ctl_skt, (struct sockaddr*)&ctl_sin, sizeof(ctl_sin)) != 0) + if (bind(ctl_skt, &ctl_sin, sizeof(ctl_sin)) != 0) { syslog(LOG_DAEMON | LOG_CRIT, "main(): Error when trying to bind() control socket."); close(skt); -- cgit v1.2.3