From 0a1f904707fa3c170032dd9dba8f2ef9207ff9b2 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sat, 3 Jul 2021 21:47:55 +0200 Subject: openocd: remove NULL comparisons with checkpatch [2/2] Patch generated automatically through a modified checkpatch that detects the patterns if (NULL == symbol) if (NULL != symbol) and through flags "--types COMPARISON_TO_NULL --fix-inplace". The unmodified checkpatch detects this pattern as Yoda condition, but it's odd fixing it as Yoda condition and then again as NULL comparison. This triggered the modification to the script. Change-Id: I5fe984a85e9c4fc799f049211797aef891ebce18 Signed-off-by: Antonio Borneo Reviewed-on: http://openocd.zylin.com/6352 Tested-by: jenkins --- src/helper/binarybuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/helper/binarybuffer.c') diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index 3d35702..49e347b 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -53,7 +53,7 @@ static const char hex_digits[] = { void *buf_cpy(const void *from, void *_to, unsigned size) { - if (NULL == from || NULL == _to) + if (!from || !_to) return NULL; /* copy entire buffer */ -- cgit v1.1