Message ID | 20210803125411.28066-1-srinivas.kandagatla@linaro.org (mailing list archive) |
---|---|
Headers | show |
Series | ASoC: qcom: Add AudioReach support | expand |
There are quite a few cppcheck warnings due to unnecessary initializations for loop variables, see suggested patch below. And a number of renames that were missed. cppcheck --platform=unix64 --force --max-configs=1024 --inconclusive --enable=all --suppress=variableScope --suppress=shiftTooManyBitsSigned --suppress=arithOperationsOnVoidPointer --suppress=bitwiseOnBoolean sound/soc/qcom/qdsp6/ Checking sound/soc/qcom/qdsp6/audioreach.c ... sound/soc/qcom/qdsp6/audioreach.c:248:32: style:inconclusive: Function 'audioreach_alloc_pkt' argument 1 names different: declaration 'pkt_size' definition 'payload_size'. [funcArgNamesDifferent] void *audioreach_alloc_pkt(int payload_size, uint32_t opcode, ^ sound/soc/qcom/qdsp6/audioreach.h:657:32: note: Function 'audioreach_alloc_pkt' argument 1 names different: declaration 'pkt_size' definition 'payload_size'. void *audioreach_alloc_pkt(int pkt_size, uint32_t opcode, uint32_t token, ^ sound/soc/qcom/qdsp6/audioreach.c:248:32: note: Function 'audioreach_alloc_pkt' argument 1 names different: declaration 'pkt_size' definition 'payload_size'. void *audioreach_alloc_pkt(int payload_size, uint32_t opcode, ^ sound/soc/qcom/qdsp6/audioreach.c:265:36: style:inconclusive: Function 'audioreach_alloc_cmd_pkt' argument 1 names different: declaration 'pkt_size' definition 'payload_size'. [funcArgNamesDifferent] void *audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, ^ sound/soc/qcom/qdsp6/audioreach.h:653:36: note: Function 'audioreach_alloc_cmd_pkt' argument 1 names different: declaration 'pkt_size' definition 'payload_size'. void *audioreach_alloc_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t token, ^ sound/soc/qcom/qdsp6/audioreach.c:265:36: note: Function 'audioreach_alloc_cmd_pkt' argument 1 names different: declaration 'pkt_size' definition 'payload_size'. void *audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, ^ sound/soc/qcom/qdsp6/q6apm.c:326:16: style:inconclusive: Function 'q6apm_map_memory_regions' argument 4 names different: declaration 'bufsz' definition 'period_sz'. [funcArgNamesDifferent] size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6apm.h:137:16: note: Function 'q6apm_map_memory_regions' argument 4 names different: declaration 'bufsz' definition 'period_sz'. size_t bufsz, unsigned int bufcnt); ^ sound/soc/qcom/qdsp6/q6apm.c:326:16: note: Function 'q6apm_map_memory_regions' argument 4 names different: declaration 'bufsz' definition 'period_sz'. size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6apm.c:326:40: style:inconclusive: Function 'q6apm_map_memory_regions' argument 5 names different: declaration 'bufcnt' definition 'periods'. [funcArgNamesDifferent] size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6apm.h:137:36: note: Function 'q6apm_map_memory_regions' argument 5 names different: declaration 'bufcnt' definition 'periods'. size_t bufsz, unsigned int bufcnt); ^ sound/soc/qcom/qdsp6/q6apm.c:326:40: note: Function 'q6apm_map_memory_regions' argument 5 names different: declaration 'bufcnt' definition 'periods'. size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6apm.c:471:35: style:inconclusive: Function 'q6apm_write_async' argument 5 names different: declaration 'flags' definition 'wflags'. [funcArgNamesDifferent] uint32_t lsw_ts, uint32_t wflags) ^ sound/soc/qcom/qdsp6/q6apm.h:131:36: note: Function 'q6apm_write_async' argument 5 names different: declaration 'flags' definition 'wflags'. uint32_t lsw_ts, uint32_t flags); ^ sound/soc/qcom/qdsp6/q6apm.c:471:35: note: Function 'q6apm_write_async' argument 5 names different: declaration 'flags' definition 'wflags'. uint32_t lsw_ts, uint32_t wflags) ^ Checking sound/soc/qcom/qdsp6/q6prm.c ... sound/soc/qcom/qdsp6/q6prm.c:158:63: style:inconclusive: Function 'q6prm_set_lpass_clock' argument 3 names different: declaration 'attri' definition 'clk_attr'. [funcArgNamesDifferent] int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, ^ sound/soc/qcom/qdsp6/q6prm.h:72:63: note: Function 'q6prm_set_lpass_clock' argument 3 names different: declaration 'attri' definition 'clk_attr'. int q6prm_set_lpass_clock(struct device *dev, int clk_id, int attri, ^ sound/soc/qcom/qdsp6/q6prm.c:158:63: note: Function 'q6prm_set_lpass_clock' argument 3 names different: declaration 'attri' definition 'clk_attr'. int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, ^
Hi Pierre, Thanks, I did run cppcheck --enable=all before sending this out, On 03/08/2021 16:00, Pierre-Louis Bossart wrote: > There are quite a few cppcheck warnings due to unnecessary > initializations for loop variables, see suggested patch below. > > And a number of renames that were missed. > > cppcheck --platform=unix64 --force --max-configs=1024 --inconclusive > --enable=all --suppress=variableScope --suppress=shiftTooManyBitsSigned > --suppress=arithOperationsOnVoidPointer --suppress=bitwiseOnBoolean > sound/soc/qcom/qdsp6/ I will try these ones and fix all the warnings before next spin! --srini > > > Checking sound/soc/qcom/qdsp6/audioreach.c ... > sound/soc/qcom/qdsp6/audioreach.c:248:32: style:inconclusive: Function > 'audioreach_alloc_pkt' argument 1 names different: declaration > 'pkt_size' definition 'payload_size'. [funcArgNamesDifferent] > void *audioreach_alloc_pkt(int payload_size, uint32_t opcode, > ^ > sound/soc/qcom/qdsp6/audioreach.h:657:32: note: Function > 'audioreach_alloc_pkt' argument 1 names different: declaration > 'pkt_size' definition 'payload_size'. > void *audioreach_alloc_pkt(int pkt_size, uint32_t opcode, uint32_t token, > ^ > sound/soc/qcom/qdsp6/audioreach.c:248:32: note: Function > 'audioreach_alloc_pkt' argument 1 names different: declaration > 'pkt_size' definition 'payload_size'. > void *audioreach_alloc_pkt(int payload_size, uint32_t opcode, > ^ > sound/soc/qcom/qdsp6/audioreach.c:265:36: style:inconclusive: Function > 'audioreach_alloc_cmd_pkt' argument 1 names different: declaration > 'pkt_size' definition 'payload_size'. [funcArgNamesDifferent] > void *audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, > ^ > sound/soc/qcom/qdsp6/audioreach.h:653:36: note: Function > 'audioreach_alloc_cmd_pkt' argument 1 names different: declaration > 'pkt_size' definition 'payload_size'. > void *audioreach_alloc_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t > token, > ^ > sound/soc/qcom/qdsp6/audioreach.c:265:36: note: Function > 'audioreach_alloc_cmd_pkt' argument 1 names different: declaration > 'pkt_size' definition 'payload_size'. > void *audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, > ^ > sound/soc/qcom/qdsp6/q6apm.c:326:16: style:inconclusive: Function > 'q6apm_map_memory_regions' argument 4 names different: declaration > 'bufsz' definition 'period_sz'. [funcArgNamesDifferent] > size_t period_sz, unsigned int periods) > ^ > sound/soc/qcom/qdsp6/q6apm.h:137:16: note: Function > 'q6apm_map_memory_regions' argument 4 names different: declaration > 'bufsz' definition 'period_sz'. > size_t bufsz, unsigned int bufcnt); > ^ > sound/soc/qcom/qdsp6/q6apm.c:326:16: note: Function > 'q6apm_map_memory_regions' argument 4 names different: declaration > 'bufsz' definition 'period_sz'. > size_t period_sz, unsigned int periods) > ^ > sound/soc/qcom/qdsp6/q6apm.c:326:40: style:inconclusive: Function > 'q6apm_map_memory_regions' argument 5 names different: declaration > 'bufcnt' definition 'periods'. [funcArgNamesDifferent] > size_t period_sz, unsigned int periods) > ^ > sound/soc/qcom/qdsp6/q6apm.h:137:36: note: Function > 'q6apm_map_memory_regions' argument 5 names different: declaration > 'bufcnt' definition 'periods'. > size_t bufsz, unsigned int bufcnt); > ^ > sound/soc/qcom/qdsp6/q6apm.c:326:40: note: Function > 'q6apm_map_memory_regions' argument 5 names different: declaration > 'bufcnt' definition 'periods'. > size_t period_sz, unsigned int periods) > ^ > sound/soc/qcom/qdsp6/q6apm.c:471:35: style:inconclusive: Function > 'q6apm_write_async' argument 5 names different: declaration 'flags' > definition 'wflags'. [funcArgNamesDifferent] > uint32_t lsw_ts, uint32_t wflags) > ^ > sound/soc/qcom/qdsp6/q6apm.h:131:36: note: Function 'q6apm_write_async' > argument 5 names different: declaration 'flags' definition 'wflags'. > uint32_t lsw_ts, uint32_t flags); > ^ > sound/soc/qcom/qdsp6/q6apm.c:471:35: note: Function 'q6apm_write_async' > argument 5 names different: declaration 'flags' definition 'wflags'. > uint32_t lsw_ts, uint32_t wflags) > ^ > > Checking sound/soc/qcom/qdsp6/q6prm.c ... > sound/soc/qcom/qdsp6/q6prm.c:158:63: style:inconclusive: Function > 'q6prm_set_lpass_clock' argument 3 names different: declaration 'attri' > definition 'clk_attr'. [funcArgNamesDifferent] > int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, > ^ > sound/soc/qcom/qdsp6/q6prm.h:72:63: note: Function > 'q6prm_set_lpass_clock' argument 3 names different: declaration 'attri' > definition 'clk_attr'. > int q6prm_set_lpass_clock(struct device *dev, int clk_id, int attri, > ^ > sound/soc/qcom/qdsp6/q6prm.c:158:63: note: Function > 'q6prm_set_lpass_clock' argument 3 names different: declaration 'attri' > definition 'clk_attr'. > int q6prm_set_lpass_clock(struct device *dev, int clk_id, int clk_attr, > ^ >