]> git.baikalelectronics.ru Git - kernel.git/commit
can: softing: softing_startstop(): fix set but not used variable warning
authorMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 8 Jan 2022 20:57:51 +0000 (21:57 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 9 Jan 2022 12:32:28 +0000 (13:32 +0100)
commitbd46222ca9b2da620495215958fe7ca75547c4dc
tree1af1fbde1ee4827202383d72b9ec60574a059940
parenteabb029a10ce1ad167eb2653e6c3eb6d9b60c5ed
can: softing: softing_startstop(): fix set but not used variable warning

In the function softing_startstop() the variable error_reporting is
assigned but not used. The code that uses this variable is commented
out. Its stated that the functionality is not finally verified.

To fix the warning:

| drivers/net/can/softing/softing_fw.c:424:9: error: variable 'error_reporting' set but not used [-Werror,-Wunused-but-set-variable]

remove the comment, activate the code, but add a "0 &&" to the if
expression and rely on the optimizer rather than the preprocessor to
remove the code.

Link: https://lore.kernel.org/all/20220109103126.1872833-1-mkl@pengutronix.de
Fixes: ad9e5a3a90ee ("can: add driver for Softing card")
Cc: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/softing/softing_fw.c