From 391782318723915bd259eadf9469251c13c8fa9c Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sat, 3 Jul 2021 21:29:32 +0200 Subject: openocd: remove NULL comparisons with checkpatch [1/2] Patch generated automatically through the new checkpatch with flags "--types COMPARISON_TO_NULL --fix-inplace". This only fixes the comparisons if (symbol == NULL) if (symbol != NULL) The case of NULL on the left side of the comparison is not tested. Some automatic fix is incorrect and has been massaged by hands: - if (*psig == NULL) + if (*!psig) changed as + if (!*psig) Change-Id: If4a1e2b4e547e223532e8e3d9da89bf9cb382ce6 Signed-off-by: Antonio Borneo Reviewed-on: http://openocd.zylin.com/6351 Tested-by: jenkins --- src/svf/svf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/svf') diff --git a/src/svf/svf.c b/src/svf/svf.c index e12fbce..553bdc7 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -587,7 +587,7 @@ static int svf_getline(char **lineptr, size_t *n, FILE *stream) #define MIN_CHUNK 16 /* Buffer is increased by this size each time as required */ size_t i = 0; - if (*lineptr == NULL) { + if (!*lineptr) { *n = MIN_CHUNK; *lineptr = malloc(*n); if (!*lineptr) -- cgit v1.1