From 95f12594a640277d408e575950d809ac96dc61e6 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Tue, 19 Mar 2024 13:01:46 +0100 Subject: [PATCH] mcp251xfd-regmap: do_mcp251xfd_regmap_read(): fix compiler warning in a more straight forward way Link: https://github.com/linux-can/can-utils/commit/d294cd928c363965e989863be99d30b50bb07d9f#r139957294 Suggested-by: Oliver Hartkopp --- mcp251xfd/mcp251xfd-regmap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mcp251xfd/mcp251xfd-regmap.c b/mcp251xfd/mcp251xfd-regmap.c index 92836ccc..643e3116 100644 --- a/mcp251xfd/mcp251xfd-regmap.c +++ b/mcp251xfd/mcp251xfd-regmap.c @@ -35,10 +35,7 @@ do_mcp251xfd_regmap_read(struct mcp251xfd_priv *priv, while ((ret = fscanf(reg_file, "%hx: %x\n", ®, &val)) != EOF) { if (ret != 2) { - int tmp; - - tmp = fscanf(reg_file, "%*[^\n]\n"); - (void)tmp; + ret = fscanf(reg_file, "%*[^\n]\n"); continue; }