Re: sys/arm/broadcom/bcm2835/bcm2838_xhci.c:184:21: error: variable 'sc' set but not used [-Werror,-Wunused-but-set-variable]

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 29 Apr 2022 03:39:55 UTC
IGNORE.

On 2022-Apr-28, at 20:33, Mark Millard <marklmi@yahoo.com> wrote:

> In attempting to update from main-n253904-4d1ba6febfa7 based to
> main-n255108-9fb40baf6043 based, targeting aarch64, the following
> code from sys/arm/broadcom/bcm2835/bcm2838_xhci.c was rejected:
> 
> static int
> bcm_xhci_attach(device_t dev)
> {
>        struct xhci_softc *sc;
>        int error;
> 
>        sc = device_get_softc(dev);
> 
>        bcm_xhci_install_xhci_firmware(dev);
> 
>        error = xhci_pci_attach(dev);
>        return (error);
> }
> 
> as follows:
> 
> --- bcm2838_xhci.o ---
> /usr/main-src/sys/arm/broadcom/bcm2835/bcm2838_xhci.c:184:21: error: variable 'sc' set but not used [-Werror,-Wunused-but-set-variable]
>        struct xhci_softc *sc;
>                           ^
> Building /usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72/imx_i2c.o
> 1 error generated.
> *** [bcm2838_xhci.o] Error code 1
> 
> make[2]: stopped in /usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72
> .ERROR_TARGET='bcm2838_xhci.o'
> .ERROR_META_FILE='/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72/bcm2838_xhci.o.meta'
> .MAKE.LEVEL='2'
> MAKEFILE=''
> .MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose curdirOk=yes'
> _ERROR_CMD='cc -target aarch64-unknown-freebsd14.0 --sysroot=/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp -B/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/usr/bin -c -O2 -pipe  -fno-strict-aliasing  -g -nostdinc  -I. -I/usr/main-src/sys -I/usr/main-src/sys/contrib/ck/include -I/usr/main-src/sys/contrib/libfdt -I/usr/main-src/sys/contrib/device-tree/include -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common   -mcpu=cortex-a72 -DLINUX_DTS_VERSION=\""5.13"\" -mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/main-src/sys/arm64/include -mgeneral-regs-only -ffixed-x18 -ffreestanding -fwrapv -fstack-protector -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mcpu=cortex-a72  -std=iso9899:1999 -Werror /usr/main-src/sys/arm/broadcom/bcm2835/bcm2838_xhci.c; ctfconvert -L VERSION -g bcm2838_xhci.o;'
> .CURDIR='/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72'
> .MAKE='make'
> .OBJDIR='/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72'
> .TARGETS='all'
> DESTDIR=''
> LD_LIBRARY_PATH=''
> MACHINE='arm64'
> MACHINE_ARCH='aarch64'
> MAKEOBJDIRPREFIX=''
> MAKESYSPATH='/usr/main-src/share/mk'
> MAKE_VERSION='20220208'
> PATH='/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/bin:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/usr/sbin:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/usr/bin:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/legacy/bin:/usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin'
> SRCTOP='/usr/main-src'
> OBJTOP='/usr/main-src'
> .MAKE.MAKEFILES='/usr/main-src/share/mk/sys.mk /usr/main-src/share/mk/local.sys.env.mk /usr/main-src/share/mk/src.sys.env.mk /usr/home/root/src.configs/src.conf.CA72-nodbg-clang.aarch64-host /usr/main-src/share/mk/bsd.mkopt.mk /usr/main-src/share/mk/src.sys.obj.mk /usr/main-src/share/mk/auto.obj.mk /usr/main-src/share/mk/bsd.suffixes.mk /usr/home/root/src.configs/make.conf /usr/main-src/share/mk/local.sys.mk /usr/main-src/share/mk/src.sys.mk /dev/null Makefile /usr/main-src/sys/conf/kern.pre.mk /usr/main-src/share/mk/bsd.own.mk /usr/main-src/share/mk/bsd.opts.mk /usr/main-src/share/mk/bsd.cpu.mk /usr/main-src/share/mk/bsd.compiler.mk /usr/main-src/share/mk/bsd.endian.mk /usr/main-src/share/mk/bsd.linker.mk /usr/main-src/sys/conf/kern.opts.mk /usr/main-src/sys/conf/kern.post.mk /usr/main-src/sys/conf/kern.mk'
> .PATH='. /usr/obj/BUILDs/main-CA72-nodbg-clang/usr/main-src/arm64.aarch64/sys/GENERIC-NODBG-CA72'
> 1 error
> 

This is because of my experimental patches for RPi4 related
issues. Sorry for the noise.



===
Mark Millard
marklmi at yahoo.com