]> git.baikalelectronics.ru Git - kernel.git/commit
cxgb: avoid open-coded offsetof()
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Sep 2021 12:16:04 +0000 (14:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Sep 2021 13:04:23 +0000 (14:04 +0100)
commit77760eb4d9da854490aef480deb4097ba4cd29b8
tree7b42e6d91d799349729d6960f378f1b57bd89398
parentba83f6d28648fd53816050e559422e60f19e8a9b
cxgb: avoid open-coded offsetof()

clang-14 does not like the custom offsetof() macro in vsc7326:

drivers/net/ethernet/chelsio/cxgb/vsc7326.c:597:3: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
                HW_STAT(RxUnicast, RxUnicastFramesOK),
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/chelsio/cxgb/vsc7326.c:594:56: note: expanded from macro 'HW_STAT'
        { reg, (&((struct cmac_statistics *)NULL)->stat_name) - (u64 *)NULL }

Rewrite this to use the version provided by the kernel.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb/vsc7326.c