diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2017-07-28 14:10:07 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-07-31 04:29:44 +0200 |
commit | daba307035faf4cc01f1ccb883b21281d91234cc (patch) | |
tree | edbd5df9285303f281524fac8064866057ce35ce /ax25/axctl.c | |
parent | 71b0582584ac5de97141ea207ddf17f7c938b2df (diff) |
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 <ralf@linux-mips.org>
Diffstat (limited to 'ax25/axctl.c')
-rw-r--r-- | ax25/axctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ax25/axctl.c b/ax25/axctl.c index c27bcdf..942b902 100644 --- a/ax25/axctl.c +++ b/ax25/axctl.c @@ -40,7 +40,8 @@ int main(int argc, char **argv) return 1; } - if ((addr = ax25_config_get_addr(argv[1])) == NULL) { + addr = ax25_config_get_addr(argv[1]); + if (addr == NULL) { fprintf(stderr, "axctl: invalid port name - %s\n", argv[1]); return 1; } @@ -52,7 +53,8 @@ int main(int argc, char **argv) if (ax25_aton_entry(argv[3], (char *)&ax25_ctl.source_addr) == -1) return 1; - if ((s = socket(AF_AX25, SOCK_SEQPACKET, 0)) < 0) { + s = socket(AF_AX25, SOCK_SEQPACKET, 0); + if (s < 0) { perror("axctl: socket"); return 1; } |