drm/sysfb: Fix unused function simpledrm_device_of_dev()
Subsystems (3)
PATCH 1/1 drm/sysfb: Fix unused function simpledrm_device_of_dev()
When building with clang, with CONFIG_OF unset, I got the following error:
drivers/gpu/drm/sysfb/simpledrm.c:247:33: error: unused function 'simpledrm_device_of_dev' [-Werror,-Wunused-function]
247 | static struct simpledrm_device *simpledrm_device_of_dev(struct drm_device *dev)
Add #if to define the function only when needed.
--- drivers/gpu/drm/sysfb/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/sysfb/simpledrm.c +2 -0
@@ -244,10 +244,12 @@ struct simpledrm_device {struct drm_connector connector; }; +#if definedCONFIG_OF && (definedCONFIG_COMMON_CLK || definedCONFIG_REGULATOR )static struct simpledrm_device *simpledrm_device_of_dev (struct drm_device *dev) { return container_of(to_drm_sysfb_device(dev), struct simpledrm_device, sysfb); } +#endif /* * Hardware
base-commit: fbe43810d563a293e3de301141d33caf1f5d5c5a
Signature · 1 line
2.49.0
Thomas Zimmermann
maintainerHi,
thanks for the patch.
Am 07.04.25 um 15:13 schrieb Jocelyn Falempe:
Quoted 21 lines
When building with clang, with
CONFIG_OFunset, I got the following error:
drivers/gpu/drm/sysfb/simpledrm.c:247:33: error: unused function 'simpledrm_device_of_dev' [-Werror,-Wunused-function]
247 | static structsimpledrm_device*simpledrm_device_of_dev(structdrm_device*dev)Add #if to define the function only when needed.
Signed-off-by Jocelyn Falempe <[email protected]>Fixes 177dfbdb7e67 ("drm/sysfb: Merge primary-plane functions")--- drivers/gpu/drm/sysfb/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/sysfb/simpledrm.c +0
-0@@ -244,10 +244,12 @@ struct simpledrm_device {struct drm_connector connector; };
drivers/gpu/drm/sysfb/simpledrm.c struct simpledrm_device { · line 255
Quoted 10 lines
drivers/gpu/drm/sysfb/simpledrm.c +2
-0+#if definedCONFIG_OF && (definedCONFIG_COMMON_CLK || definedCONFIG_REGULATOR )static struct simpledrm_device *simpledrm_device_of_dev (struct drm_device *dev) { return container_of(to_drm_sysfb_device(dev), struct simpledrm_device, sysfb); } +#endif /* * Hardware
There's the same #if right below this comment. Please move the function there.
The helper used to be used throughout the driver, but that is no longer the case. Apologies for missing it.
Best regards
Thomas
Quoted 2 lines
base-commit:
fbe43810d563a293e3de301141d33caf1f5d5c5a
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)