[Bug 261687] On powerpc* bus_space_unmap() is not available due to header mismatch

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 03 Feb 2022 01:14:17 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261687

            Bug ID: 261687
           Summary: On powerpc* bus_space_unmap() is not available due to
                    header mismatch
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: powerpc
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: pkubaj@FreeBSD.org

From machine/bus.h:
#define bus_space_unmap(t, h, s)        (*(t)->bs_unmap)(h, s)

So bus_space_unmap() executes bs_unmap() and gives it two arguments.

However, from the same file:
void    (*bs_unmap)(bus_size_t);

So bs_unmap actually takes one argument, not two.

Found during build of net/realtek-re-kmod port:
cc  -O2 -pipe -fno-strict-aliasing  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  
-include
/wrkdirs/usr/ports/net/realtek-re-kmod/work/rtl_bsd_drv_v196.04/opt_global.h
-I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fPIC
-mlongcall -fno-omit-frame-pointer
-fdebug-prefix-map=./machine=/usr/src/sys/powerpc/include     -MD 
-MF.depend.if_re.o -MTif_re.o -mno-altivec -msoft-float -mabi=elfv2
-ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls
-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     -std=iso9899:1999 -c
if_re.c -o if_re.o
if_re.c:5306:77: error: too many arguments to function call, expected 1, have 2
                bus_space_unmap(sc->re_cmac_tag, sc->re_mapped_cmac_handle,
RE_REGS_SIZE);
               
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
./if_rereg.h:1181:26: note: expanded from macro 'RE_REGS_SIZE'
#define RE_REGS_SIZE     (256)
                         ^~~~~
./machine/bus.h:281:54: note: expanded from macro 'bus_space_unmap'
#define bus_space_unmap(t, h, s)        (*(t)->bs_unmap)(h, s)
                                        ~~~~~~~~~~~~~~~~    ^
1 error generated.

-- 
You are receiving this mail because:
You are the assignee for the bug.