DisplayLink / evdi

Extensible Virtual Display Interface
MIT License
689 stars 179 forks source link

Use simple format string for name since printf args are checked now #396

Closed marcushall42 closed 1 year ago

marcushall42 commented 1 year ago

When building against the 6.1.6 kernel (maybe others..) the name field in drm_encodeer_init() is checked as a printf format string. This causes a fatal error:

2023/01/24 11:37:04 akmodsbuild: /tmp/akmodsbuild.N6DUGkQn/BUILD/evdi-bdc258b25df4d00f222fde0e3c5003bf88ef17b5/_kmod_build_6.1.6-100.fc36.x86_64/evdi_encoder.c:57:32: error: format not a string literal and no format arguments [-Werror=format-security] 2023/01/24 11:37:04 akmodsbuild: 57 | DRM_MODE_ENCODER_TMDS, dev_name(dev->dev)); 2023/01/24 11:37:04 akmodsbuild: | ^~~~~ 2023/01/24 11:37:04 akmodsbuild: cc1: some warnings being treated as errors 2023/01/24 11:37:04 akmodsbuild: make[1]: *** [scripts/Makefile.build:250: /tmp/akmodsbuild.N6DUGkQn/BUILD/evdi-bdc258b25df4d00f222fde0e3c5003bf88ef17b5/_kmod_build_6.1.6-100.fc36.x86_64/evdi_encoder.o] Error 1

This change makes name be a "%s" format string with dev_name(dev->dev) as the sole following arg.

displaylink-emajewsk commented 1 year ago

Thanks!