[PATCH 1/4] ASN.1: Adjust two function calls together with a variable assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Nov 2017 10:40:17 +0100

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
 scripts/asn1_compiler.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c
index c1b7ef3e24c1..e37e5ef3fabb 100644
--- a/scripts/asn1_compiler.c
+++ b/scripts/asn1_compiler.c
@@ -606,12 +606,14 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 
-	if (!(buffer = malloc(st.st_size + 1))) {
+	buffer = malloc(st.st_size + 1);
+	if (!buffer) {
 		perror(NULL);
 		exit(1);
 	}
 
-	if ((readlen = read(fd, buffer, st.st_size)) < 0) {
+	readlen = read(fd, buffer, st.st_size);
+	if (readlen < 0) {
 		perror(filename);
 		exit(1);
 	}
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux