]> git.baikalelectronics.ru Git - kernel.git/commit
gpu: amd: replace open-coded offsetof() with builtin
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Sep 2021 12:20:41 +0000 (14:20 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Sep 2021 21:30:00 +0000 (17:30 -0400)
commitfa4967cc6585a974cd1633ac0eb2c504b7c3ea67
tree28c43c7c823796a18a5583a7d65de3830349151d
parent1dc1f94f3937b63ab29fdf4cbfb9808a4d1c8eff
gpu: amd: replace open-coded offsetof() with builtin

The two AMD drivers have their own custom offsetof() implementation
that now triggers a warning with recent versions of clang:

drivers/gpu/drm/radeon/radeon_atombios.c:133:14: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]

Change all the instances to use the normal offsetof() provided
by the kernel that does not have this problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/command_table2.c
drivers/gpu/drm/amd/include/atombios.h
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomfwctrl.h
drivers/gpu/drm/radeon/atombios.h