Skip to content

Commit

Permalink
Fix gcc unused value warning in FreeBSD simd.h
Browse files Browse the repository at this point in the history
The macros `simd_stat_init()` and `simd_stat_fini()` in FreeBSD's
`simd.h` are defined as zero, but they are actually only used as
statements. Replace the definitions with `do {} while (0)` instead, to
avoid gcc `-Wunused-value` warnings.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Toomas Soome <tsoome@me.com>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes openzfs#16693
  • Loading branch information
DimitryAndric authored and behlendorf committed Nov 1, 2024
1 parent f7b4bca commit fd2cae9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/os/freebsd/spl/sys/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#define kfpu_fini() do {} while (0)
#endif

#define simd_stat_init() 0
#define simd_stat_fini() 0
#define simd_stat_init() do {} while (0)
#define simd_stat_fini() do {} while (0)

#endif

0 comments on commit fd2cae9

Please sign in to comment.