From d294cd928c363965e989863be99d30b50bb07d9f Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Mon, 18 Mar 2024 13:13:10 +0100 Subject: [PATCH] mcp251xfd-regmap: fix compiler warning Fix the following compiler warning: | mcp251xfd/mcp251xfd-regmap.c:38:4: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] | fscanf(reg_file, "%*[^\n]\n"); | ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~ Reported-by: https://github.com/Chaitanya84 Link: https://github.com/linux-can/can-utils/pull/506 --- mcp251xfd/mcp251xfd-regmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mcp251xfd/mcp251xfd-regmap.c b/mcp251xfd/mcp251xfd-regmap.c index 11447226..92836ccc 100644 --- a/mcp251xfd/mcp251xfd-regmap.c +++ b/mcp251xfd/mcp251xfd-regmap.c @@ -35,7 +35,11 @@ do_mcp251xfd_regmap_read(struct mcp251xfd_priv *priv, while ((ret = fscanf(reg_file, "%hx: %x\n", ®, &val)) != EOF) { if (ret != 2) { - fscanf(reg_file, "%*[^\n]\n"); + int tmp; + + tmp = fscanf(reg_file, "%*[^\n]\n"); + (void)tmp; + continue; }