Skip to content

Cleanup build-time warnings - #11

Merged
quic-aditrath merged 5 commits into
AudioReach:masterfrom
lumag:fix-build
Oct 13, 2025
Merged

quic-aditrath merged 5 commits into
AudioReach:masterfrom
lumag:fix-build

Conversation

@lumag

@lumag lumag commented Sep 29, 2025

Copy link
Copy Markdown
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>
@quic-aditrath

Copy link
Copy Markdown
Contributor

Thanks @lumag for the change to clean up build time warnings.

Regarding the following commits:

  • audioreach-driver: drop unused functions and variables
  • audioreach-driver: mark local functions as static

The commit message description exceeds the recommended per-line character limit. Can we move the warning messages to PR description instead?

@lumag

lumag commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

The commit message description exceeds the recommended per-line character limit. Can we move the warning messages to PR description instead?

Why? It's a well established practice in the kernel world.

@quic-aditrath
quic-aditrath merged commit 2845e99 into AudioReach:master Oct 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants