Skip to content

Commit

Permalink
mcp251xfd-regmap: fix compiler warning
Browse files Browse the repository at this point in the history
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: linux-can#506
  • Loading branch information
marckleinebudde committed Mar 19, 2024
1 parent 6d47f5c commit d294cd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mcp251xfd/mcp251xfd-regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ do_mcp251xfd_regmap_read(struct mcp251xfd_priv *priv,

while ((ret = fscanf(reg_file, "%hx: %x\n", &reg, &val)) != EOF) {
if (ret != 2) {
fscanf(reg_file, "%*[^\n]\n");
int tmp;

tmp = fscanf(reg_file, "%*[^\n]\n");
(void)tmp;

continue;
}

Expand Down

0 comments on commit d294cd9

Please sign in to comment.