Cleanup build-time warnings - #11
Merged
Merged
Conversation
lumag
commented
Sep 29, 2025
Contributor
- Mark non-public functions as static
- Drop unused functions
- Drop unused variables
Other include directives include directly include files under the qdsp6 subdir of the Linux kernel. Drop extra path from the "qdsp6/qafe6.h" include directive. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Let Git ignore autogenerated files. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
The Audioreach driver consists of a single module. Drop all EXPORT_SYMBOL_GPL declarations to prevent symbol pollution. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fix several compiler warnings by dropping unused variables and
functions.
q6apm_audio_mem.c:365:6: warning: no previous prototype for ‘msm_audio_fd_list_debug’ [-Wmissing-prototypes]
365 | void msm_audio_fd_list_debug(void)
| ^~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_mem.c: In function ‘q6apm_audio_mem_probe’:
q6apm_audio_mem.c:807:21: warning: unused variable ‘msm_audio_mem_smmu_sid_mask’ [-Wunused-variable]
807 | const char *msm_audio_mem_smmu_sid_mask = "qcom,smmu-sid-mask";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_mem.c:806:21: warning: unused variable ‘msm_audio_mem_dt’ [-Wunused-variable]
806 | const char *msm_audio_mem_dt = "qcom,smmu-enabled";
| ^~~~~~~~~~~~~~~~
q6apm_audio_pkt.c: In function ‘q6apm_audio_pkt_callback’:
q6apm_audio_pkt.c:644:24: warning: unused variable ‘dev’ [-Wunused-variable]
644 | struct device *dev = &gdev->dev;
| ^~~
q6apm_audio_pkt.c: At top level:
q6apm_audio_pkt.c:36:13: warning: ‘audio_pkt_probed’ defined but not used [-Wunused-variable]
36 | static bool audio_pkt_probed;
| ^~~~~~~~~~~~~~~~
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
In order to fix compiler warnings, declare functions without a prototype
as static.
q6apm_audio_mem.c:366:6: warning: no previous prototype for ‘msm_audio_update_fd_list’ [-Wmissing-prototypes]
366 | void msm_audio_update_fd_list(struct msm_audio_fd_data *msm_audio_fd_data)
| ^~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_mem.c:384:6: warning: no previous prototype for ‘msm_audio_delete_fd_entry’ [-Wmissing-prototypes]
384 | void msm_audio_delete_fd_entry(void *handle)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_mem.c:432:5: warning: no previous prototype for ‘msm_audio_set_hyp_assign’ [-Wmissing-prototypes]
432 | int msm_audio_set_hyp_assign(int fd, bool assign)
| ^~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_mem.c:452:6: warning: no previous prototype for ‘msm_audio_get_handle’ [-Wmissing-prototypes]
452 | void msm_audio_get_handle(int fd, void **handle)
| ^~~~~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:182:5: warning: no previous prototype for ‘q6apm_send_audio_cmd_sync’ [-Wmissing-prototypes]
182 | int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:231:5: warning: no previous prototype for ‘q6apm_audio_send_cmd’ [-Wmissing-prototypes]
231 | int q6apm_audio_send_cmd(struct q6apm_audio_pkt *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode)
| ^~~~~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:276:7: warning: no previous prototype for ‘q6apm_audio_alloc_apm_cmd_pkt’ [-Wmissing-prototypes]
276 | void *q6apm_audio_alloc_apm_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t token)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:305:6: warning: no previous prototype for ‘q6apm_audio_close_all’ [-Wmissing-prototypes]
305 | void q6apm_audio_close_all(void)
| ^~~~~~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:318:5: warning: no previous prototype for ‘audio_pkt_open’ [-Wmissing-prototypes]
318 | int audio_pkt_open(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~
q6apm_audio_pkt.c:340:5: warning: no previous prototype for ‘audio_pkt_release’ [-Wmissing-prototypes]
340 | int audio_pkt_release(struct inode *inode, struct file *file)
| ^~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:376:9: warning: no previous prototype for ‘audio_pkt_read’ [-Wmissing-prototypes]
376 | ssize_t audio_pkt_read(struct file *file, char __user *buf,
| ^~~~~~~~~~~~~~
q6apm_audio_pkt.c:424:5: warning: no previous prototype for ‘audpkt_chk_and_update_physical_addr’ [-Wmissing-prototypes]
424 | int audpkt_chk_and_update_physical_addr(struct audio_gpr_pkt *gpr_pkt)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
q6apm_audio_pkt.c:462:9: warning: no previous prototype for ‘audio_pkt_write’ [-Wmissing-prototypes]
462 | ssize_t audio_pkt_write(struct file *file, const char __user *buf,
| ^~~~~~~~~~~~~~~
q6apm_lpass_dummy_dais.c:113:5: warning: no previous prototype for ‘q6apm_lpass_dummy_dais_init’ [-Wmissing-prototypes]
113 | int q6apm_lpass_dummy_dais_init(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
q6apm_lpass_dummy_dais.c:118:6: warning: no previous prototype for ‘q6apm_lpass_dummy_dais_exit’ [-Wmissing-prototypes]
118 | void q6apm_lpass_dummy_dais_exit(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
q6prm_audioreach.c:54:5: warning: no previous prototype for ‘q6prm_audio_send_cmd_sync’ [-Wmissing-prototypes]
54 | int q6prm_audio_send_cmd_sync(struct device *dev, gpr_device_t *gdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
q6prm_audioreach.c:142:7: warning: no previous prototype for ‘q6prm_audioreach_alloc_cmd_pkt’ [-Wmissing-prototypes]
142 | void *q6prm_audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, uint32_t token,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
audioreach_common.c:67:5: warning: no previous prototype for ‘qcs6490_snd_dp_jack_setup’ [-Wmissing-prototypes]
67 | int qcs6490_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
audioreach_common.c:91:5: warning: no previous prototype for ‘qcs6490_snd_wcd_jack_setup’ [-Wmissing-prototypes]
91 | int qcs6490_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
audioreach_common.c:145:6: warning: no previous prototype for ‘audioreach_get_link_name’ [-Wmissing-prototypes]
145 | void audioreach_get_link_name(const char **link_name, int dai_id)
| ^~~~~~~~~~~~~~~~~~~~~~~~
audioreach_common.c:204:5: warning: no previous prototype for ‘qcs6490_snd_parse_of’ [-Wmissing-prototypes]
204 | int qcs6490_snd_parse_of(struct snd_soc_card *card)
| ^~~~~~~~~~~~~~~~~~~~
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Contributor
|
Thanks @lumag for the change to clean up build time warnings. Regarding the following commits:
The commit message description exceeds the recommended per-line character limit. Can we move the warning messages to PR description instead? |
Contributor
Author
Why? It's a well established practice in the kernel world. |
quic-aditrath
approved these changes
Oct 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.