Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatch

./scripts/checkpatch.pl --strict --codespell detected several issues
when running on the fsl_qmc_audio.c file:
- CHECK: spaces preferred around that '*' (ctx:VxV)
- CHECK: Alignment should match open parenthesis
- CHECK: Comparison to NULL could be written "!prtd"
- CHECK: spaces preferred around that '/' (ctx:VxV)
- CHECK: Lines should not end with a '('
- CHECK: Please don't use multiple blank lines
Some of them are present several times.

Fix all of these issues without any functional changes.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20240701113038.55144-3-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Herve Codina and committed by
Mark Brown
86dd725b e6259990

+31 -34
+31 -34
sound/soc/fsl/fsl_qmc_audio.c
··· 54 54 return ret; 55 55 56 56 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, card->dev, 57 - 64*1024, 64*1024); 57 + 64 * 1024, 64 * 1024); 58 58 return 0; 59 59 } 60 60 ··· 89 89 prtd->period_ptr_submitted = prtd->dma_buffer_start; 90 90 91 91 ret = qmc_chan_write_submit(prtd->qmc_dai->qmc_chan, 92 - prtd->period_ptr_submitted, prtd->period_size, 93 - qmc_audio_pcm_write_complete, prtd); 92 + prtd->period_ptr_submitted, prtd->period_size, 93 + qmc_audio_pcm_write_complete, prtd); 94 94 if (ret) { 95 95 dev_err(prtd->qmc_dai->dev, "write_submit failed %d\n", 96 96 ret); ··· 118 118 prtd->period_ptr_submitted = prtd->dma_buffer_start; 119 119 120 120 ret = qmc_chan_read_submit(prtd->qmc_dai->qmc_chan, 121 - prtd->period_ptr_submitted, prtd->period_size, 122 - qmc_audio_pcm_read_complete, prtd); 121 + prtd->period_ptr_submitted, prtd->period_size, 122 + qmc_audio_pcm_read_complete, prtd); 123 123 if (ret) { 124 124 dev_err(prtd->qmc_dai->dev, "read_submit failed %d\n", 125 125 ret); ··· 144 144 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 145 145 /* Submit first chunk ... */ 146 146 ret = qmc_chan_write_submit(prtd->qmc_dai->qmc_chan, 147 - prtd->period_ptr_submitted, prtd->period_size, 148 - qmc_audio_pcm_write_complete, prtd); 147 + prtd->period_ptr_submitted, prtd->period_size, 148 + qmc_audio_pcm_write_complete, prtd); 149 149 if (ret) { 150 150 dev_err(component->dev, "write_submit failed %d\n", 151 151 ret); ··· 159 159 160 160 /* ... and send it */ 161 161 ret = qmc_chan_write_submit(prtd->qmc_dai->qmc_chan, 162 - prtd->period_ptr_submitted, prtd->period_size, 163 - qmc_audio_pcm_write_complete, prtd); 162 + prtd->period_ptr_submitted, prtd->period_size, 163 + qmc_audio_pcm_write_complete, prtd); 164 164 if (ret) { 165 165 dev_err(component->dev, "write_submit failed %d\n", 166 166 ret); ··· 169 169 } else { 170 170 /* Submit first chunk ... */ 171 171 ret = qmc_chan_read_submit(prtd->qmc_dai->qmc_chan, 172 - prtd->period_ptr_submitted, prtd->period_size, 173 - qmc_audio_pcm_read_complete, prtd); 172 + prtd->period_ptr_submitted, prtd->period_size, 173 + qmc_audio_pcm_read_complete, prtd); 174 174 if (ret) { 175 175 dev_err(component->dev, "read_submit failed %d\n", 176 176 ret); ··· 184 184 185 185 /* ... and send it */ 186 186 ret = qmc_chan_read_submit(prtd->qmc_dai->qmc_chan, 187 - prtd->period_ptr_submitted, prtd->period_size, 188 - qmc_audio_pcm_read_complete, prtd); 187 + prtd->period_ptr_submitted, prtd->period_size, 188 + qmc_audio_pcm_read_complete, prtd); 189 189 if (ret) { 190 190 dev_err(component->dev, "write_submit failed %d\n", 191 191 ret); ··· 220 220 } 221 221 222 222 static int qmc_audio_of_xlate_dai_name(struct snd_soc_component *component, 223 - const struct of_phandle_args *args, 224 - const char **dai_name) 223 + const struct of_phandle_args *args, 224 + const char **dai_name) 225 225 { 226 226 struct qmc_audio *qmc_audio = dev_get_drvdata(component->dev); 227 227 struct snd_soc_dai_driver *dai_driver; ··· 245 245 SNDRV_PCM_INFO_INTERLEAVED | 246 246 SNDRV_PCM_INFO_PAUSE, 247 247 .period_bytes_min = 32, 248 - .period_bytes_max = 64*1024, 248 + .period_bytes_max = 64 * 1024, 249 249 .periods_min = 2, 250 - .periods_max = 2*1024, 251 - .buffer_bytes_max = 64*1024, 250 + .periods_max = 2 * 1024, 251 + .buffer_bytes_max = 64 * 1024, 252 252 }; 253 253 254 254 static int qmc_audio_pcm_open(struct snd_soc_component *component, ··· 266 266 return ret; 267 267 268 268 prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); 269 - if (prtd == NULL) 269 + if (!prtd) 270 270 return -ENOMEM; 271 271 272 272 runtime->private_data = prtd; ··· 329 329 ch.max = nb_ts; 330 330 break; 331 331 case 16: 332 - ch.max = nb_ts/2; 332 + ch.max = nb_ts / 2; 333 333 break; 334 334 case 32: 335 - ch.max = nb_ts/4; 335 + ch.max = nb_ts / 4; 336 336 break; 337 337 case 64: 338 - ch.max = nb_ts/8; 338 + ch.max = nb_ts / 8; 339 339 break; 340 340 default: 341 341 dev_err(qmc_dai->dev, "format physical width %u not supported\n", ··· 356 356 return qmc_dai_hw_rule_channels_by_format(qmc_dai, params, qmc_dai->nb_tx_ts); 357 357 } 358 358 359 - static int qmc_dai_hw_rule_capture_channels_by_format( 360 - struct snd_pcm_hw_params *params, 361 - struct snd_pcm_hw_rule *rule) 359 + static int qmc_dai_hw_rule_capture_channels_by_format(struct snd_pcm_hw_params *params, 360 + struct snd_pcm_hw_rule *rule) 362 361 { 363 362 struct qmc_dai *qmc_dai = rule->private; 364 363 ··· 393 394 return snd_mask_refine(f_old, &f_new); 394 395 } 395 396 396 - static int qmc_dai_hw_rule_playback_format_by_channels( 397 - struct snd_pcm_hw_params *params, 398 - struct snd_pcm_hw_rule *rule) 397 + static int qmc_dai_hw_rule_playback_format_by_channels(struct snd_pcm_hw_params *params, 398 + struct snd_pcm_hw_rule *rule) 399 399 { 400 400 struct qmc_dai *qmc_dai = rule->private; 401 401 402 402 return qmc_dai_hw_rule_format_by_channels(qmc_dai, params, qmc_dai->nb_tx_ts); 403 403 } 404 404 405 - static int qmc_dai_hw_rule_capture_format_by_channels( 406 - struct snd_pcm_hw_params *params, 407 - struct snd_pcm_hw_rule *rule) 405 + static int qmc_dai_hw_rule_capture_format_by_channels(struct snd_pcm_hw_params *params, 406 + struct snd_pcm_hw_rule *rule) 408 407 { 409 408 struct qmc_dai *qmc_dai = rule->private; 410 409 ··· 410 413 } 411 414 412 415 static int qmc_dai_startup(struct snd_pcm_substream *substream, 413 - struct snd_soc_dai *dai) 416 + struct snd_soc_dai *dai) 414 417 { 415 418 struct qmc_dai_prtd *prtd = substream->runtime->private_data; 416 419 snd_pcm_hw_rule_func_t hw_rule_channels_by_format; ··· 584 587 } 585 588 586 589 static int qmc_audio_dai_parse(struct qmc_audio *qmc_audio, struct device_node *np, 587 - struct qmc_dai *qmc_dai, struct snd_soc_dai_driver *qmc_soc_dai_driver) 590 + struct qmc_dai *qmc_dai, 591 + struct snd_soc_dai_driver *qmc_soc_dai_driver) 588 592 { 589 593 struct qmc_chan_info info; 590 594 u32 val; ··· 701 703 } 702 704 i++; 703 705 } 704 - 705 706 706 707 platform_set_drvdata(pdev, qmc_audio); 707 708