emulators/rtc: Unbreak build with llvm13

rtc.c:112:6: error: variable 'unit' set but not used [-Werror,-Wunused-but-set-variable]
        int unit;
            ^

PR:		263616
This commit is contained in:
Jamie Landeg-Jones 2022-05-14 11:34:13 -05:00 committed by Dmitri Goutnik
parent 71c2509817
commit e2c8ca5df4

View file

@ -109,10 +109,16 @@ static struct rtc_softc *
rtc_attach(struct cdev *dev)
{
struct rtc_softc *sc;
/* Clang 13+ realises that "unit" below isn't actually used if we */
/* aren't running with DEBUG set. The warning is treated as a */
/* fatal error by FreeBSD's kmod build system, so wrap its usage */
/* within DEBUG pre-processor conditionals. - Jamie Landeg-Jones */
#if DEBUG
int unit;
unit = dev2unit(dev);
DLog(Lenter, "%d %p", unit, dev);
#endif /* DEBUG */
if (dev->si_drv1) {
DLog(Lexit, "old %p, %p", dev, dev->si_drv1);
return dev->si_drv1;