From daba307035faf4cc01f1ccb883b21281d91234cc Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 28 Jul 2017 14:10:07 +0200 Subject: treewide: Kill assignments in if conditions. Somewhat hard to read and the code base already has many overlong lines. Found with below spatch file and some manual editing in ax25/access.c to restore a comment lost by spatch. @parens@ expression E, F, G; binary operator X; statement S; @@ - if ((E = F) X G) + E = F; + if (E X G) S Signed-off-by: Ralf Baechle --- ax25/axgetput/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ax25/axgetput/util.c') diff --git a/ax25/axgetput/util.c b/ax25/axgetput/util.c index c09de1a..a4a83c0 100644 --- a/ax25/axgetput/util.c +++ b/ax25/axgetput/util.c @@ -53,7 +53,8 @@ int my_read(int fd, char *s, int len_max, int *eof, char *p_break) int len; char *s_curr = s + len_got; - if ((len = read(fd, s_curr, (p_break ? 1 : len_max))) < 1) { + len = read(fd, s_curr, (p_break ? 1 : len_max)); + if (len < 1) { if (len == -1 && errno == EAGAIN) { sleep(10); continue; @@ -88,7 +89,8 @@ int secure_write(int fd, char *s, int len_write) { while (len_write_left_curr) { int len; - if ((len = write(fd, s, len_write_left_curr)) < 0) { + len = write(fd, s, len_write_left_curr); + if (len < 0) { if (len == -1 && errno == EAGAIN) { sleep(10); continue; -- cgit v1.2.3