Skip to content

Commit 370d988

Browse files
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/[email protected] Fixes: 03fd3cf ("can: add driver for Softing card") Cc: Kurt Van Dijck <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent ced4913 commit 370d988

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/net/can/softing/softing_fw.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,18 +565,19 @@ int softing_startstop(struct net_device *dev, int up)
565565
if (ret < 0)
566566
goto failed;
567567
}
568-
/* enable_error_frame */
569-
/*
568+
569+
/* enable_error_frame
570+
*
570571
* Error reporting is switched off at the moment since
571572
* the receiving of them is not yet 100% verified
572573
* This should be enabled sooner or later
573-
*
574-
if (error_reporting) {
574+
*/
575+
if (0 && error_reporting) {
575576
ret = softing_fct_cmd(card, 51, "enable_error_frame");
576577
if (ret < 0)
577578
goto failed;
578579
}
579-
*/
580+
580581
/* initialize interface */
581582
iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 2]);
582583
iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 4]);

0 commit comments

Comments
 (0)