From cc4dced2f80ae7bf79bde1c06f1daee6f08c7712 Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Tue, 24 Jun 2025 06:44:03 +0200 Subject: [PATCH] sahara: address checkpatch issues CHECK: Macro argument reuse 'x' - possible side-effects? +#define MIN(x, y) ((x) < (y) ? (x) : (y)) CHECK: Macro argument reuse 'y' - possible side-effects? +#define MIN(x, y) ((x) < (y) ? (x) : (y)) CHECK: line length of 123 exceeds 120 columns + ux_debug("%-2d: type 0x%" PRIx64 " address: 0x%" PRIx64 " length: 0x%" PRIx64 " region: %s filename: %s\ Signed-off-by: Igor Opaniuk --- sahara.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sahara.c b/sahara.c index b8f3b18..40d8f69 100644 --- a/sahara.c +++ b/sahara.c @@ -19,7 +19,11 @@ #include "qdl.h" #include "oscompat.h" -#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#define MIN(x, y) ({ \ + __typeof__(x) _x = (x); \ + __typeof__(y) _y = (y); \ + _x < _y ? _x : _y; \ +}) #define SAHARA_HELLO_CMD 0x1 /* Min protocol version 1.0 */ #define SAHARA_HELLO_RESP_CMD 0x2 /* Min protocol version 1.0 */ @@ -420,8 +424,10 @@ static void sahara_debug64(struct qdl_device *qdl, struct sahara_pkt *pkt, if (sahara_debug64_filter(table[i].filename, filter)) continue; - ux_debug("%-2d: type 0x%" PRIx64 " address: 0x%" PRIx64 " length: 0x%" PRIx64 " region: %s filename: %s\n", - i, table[i].type, table[i].addr, table[i].length, table[i].region, table[i].filename); + ux_debug("%-2d: type 0x%" PRIx64 " address: 0x%" PRIx64 " length: 0x%" + PRIx64 " region: %s filename: %s\n", + i, table[i].type, table[i].addr, table[i].length, + table[i].region, table[i].filename); n = sahara_debug64_one(qdl, table[i], ramdump_path); if (n < 0)