Skip to contentSkip to conversation

drm/client: remove the exporting of drm_client_close

PATCH Applied Denis Efremov 3 participants 4 messages Jul 3, 2019 – Jul 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/client: remove the exporting of drm_client_close

The function drm_client_close is declared as static and marked as EXPORT_SYMBOL. It's a bit confusing for an internal function to be exported. The area of visibility for such function is its .c file and all other modules. Other *.c files of the same module can't use it, despite all other modules can. Relying on the fact that this is the internal function and it's not a crucial part of the API, the patch removes the EXPORT_SYMBOL marking of drm_client_close.

---
 drivers/gpu/drm/drm_client.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/drm_client.c +0 -1
index f20d1dda3961..bffc87ac21c7 100644
@@ -60,7 +60,6 @@ static void drm_client_close(struct drm_client_dev *client)
 
 	drm_file_free(client->file);
 }
-EXPORT_SYMBOL(drm_client_close);
 
 /**
  * drm_client_init - Initialise a DRM client
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Denis Efremov

The function drm_client_close is declared as static and marked as EXPORT_SYMBOL. It's a bit confusing for an internal function to be exported. The area of visibility for such function is its .c file and all other modules. Other *.c files of the same module can't use it, despite all other modules can. Relying on the fact that this is the internal function and it's not a crucial part of the API, the patch removes the EXPORT_SYMBOL marking of drm_client_close.

Nice one:

Out of curiosity: Did you use some tool to spot this?

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 3 lines

Out of curiosity: Did you use some tool to spot this?

Just regular expressions:
https://github.com/evdenis/export_checking

But it's not very reliable because of false positives. I think I can try to implement this kind of check as a part of modpost in addition to CONFIG_DEBUG_SECTION_MISMATCH.

Denis

#3 lore raw
In reply to Emil Velikov

Den 04.07.2019 16.07, skrev Emil Velikov:

Quoted 10 lines · Denis Efremov
Quoted 9 lines

The function drm_client_close is declared as static and marked as EXPORT_SYMBOL. It's a bit confusing for an internal function to be exported. The area of visibility for such function is its .c file and all other modules. Other *.c files of the same module can't use it, despite all other modules can. Relying on the fact that this is the internal function and it's not a crucial part of the API, the patch removes the EXPORT_SYMBOL marking of drm_client_close.

Quoted 4 lines
Quoted 1 line

Nice one:

Thanks, applied.

Noralf.