aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-23 03:20:29 -0400
committerTakashi Iwai <tiwai@suse.de>2017-08-23 04:36:18 -0400
commitc8da9be4a75f1f63024a16b976c5be47405c13dc (patch)
treef9459f3b9afec95b0f712e4c642c8fb099857ffd /sound/core
parent97d15a141f84a02d40d2ee442df5c6bd2f62b3d8 (diff)
ALSA: pcm: Adjust nine function calls together with a variable assignment
The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 048df9658f50..c790f79e45ae 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -523,7 +523,9 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
523 523
524 sprintf(name, "pcm%i%c", pcm->device, 524 sprintf(name, "pcm%i%c", pcm->device,
525 pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); 525 pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c');
526 if ((entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root)) == NULL) 526 entry = snd_info_create_card_entry(pcm->card, name,
527 pcm->card->proc_root);
528 if (!entry)
527 return -ENOMEM; 529 return -ENOMEM;
528 entry->mode = S_IFDIR | S_IRUGO | S_IXUGO; 530 entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
529 if (snd_info_register(entry) < 0) { 531 if (snd_info_register(entry) < 0) {
@@ -531,8 +533,8 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
531 return -ENOMEM; 533 return -ENOMEM;
532 } 534 }
533 pstr->proc_root = entry; 535 pstr->proc_root = entry;
534 536 entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root);
535 if ((entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root)) != NULL) { 537 if (entry) {
536 snd_info_set_text_ops(entry, pstr, snd_pcm_stream_proc_info_read); 538 snd_info_set_text_ops(entry, pstr, snd_pcm_stream_proc_info_read);
537 if (snd_info_register(entry) < 0) { 539 if (snd_info_register(entry) < 0) {
538 snd_info_free_entry(entry); 540 snd_info_free_entry(entry);
@@ -542,8 +544,9 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
542 pstr->proc_info_entry = entry; 544 pstr->proc_info_entry = entry;
543 545
544#ifdef CONFIG_SND_PCM_XRUN_DEBUG 546#ifdef CONFIG_SND_PCM_XRUN_DEBUG
545 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", 547 entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
546 pstr->proc_root)) != NULL) { 548 pstr->proc_root);
549 if (entry) {
547 entry->c.text.read = snd_pcm_xrun_debug_read; 550 entry->c.text.read = snd_pcm_xrun_debug_read;
548 entry->c.text.write = snd_pcm_xrun_debug_write; 551 entry->c.text.write = snd_pcm_xrun_debug_write;
549 entry->mode |= S_IWUSR; 552 entry->mode |= S_IWUSR;
@@ -580,7 +583,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
580 card = substream->pcm->card; 583 card = substream->pcm->card;
581 584
582 sprintf(name, "sub%i", substream->number); 585 sprintf(name, "sub%i", substream->number);
583 if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL) 586 entry = snd_info_create_card_entry(card, name,
587 substream->pstr->proc_root);
588 if (!entry)
584 return -ENOMEM; 589 return -ENOMEM;
585 entry->mode = S_IFDIR | S_IRUGO | S_IXUGO; 590 entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
586 if (snd_info_register(entry) < 0) { 591 if (snd_info_register(entry) < 0) {
@@ -588,8 +593,8 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
588 return -ENOMEM; 593 return -ENOMEM;
589 } 594 }
590 substream->proc_root = entry; 595 substream->proc_root = entry;
591 596 entry = snd_info_create_card_entry(card, "info", substream->proc_root);
592 if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) { 597 if (entry) {
593 snd_info_set_text_ops(entry, substream, 598 snd_info_set_text_ops(entry, substream,
594 snd_pcm_substream_proc_info_read); 599 snd_pcm_substream_proc_info_read);
595 if (snd_info_register(entry) < 0) { 600 if (snd_info_register(entry) < 0) {
@@ -598,8 +603,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
598 } 603 }
599 } 604 }
600 substream->proc_info_entry = entry; 605 substream->proc_info_entry = entry;
601 606 entry = snd_info_create_card_entry(card, "hw_params",
602 if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) { 607 substream->proc_root);
608 if (entry) {
603 snd_info_set_text_ops(entry, substream, 609 snd_info_set_text_ops(entry, substream,
604 snd_pcm_substream_proc_hw_params_read); 610 snd_pcm_substream_proc_hw_params_read);
605 if (snd_info_register(entry) < 0) { 611 if (snd_info_register(entry) < 0) {
@@ -608,8 +614,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
608 } 614 }
609 } 615 }
610 substream->proc_hw_params_entry = entry; 616 substream->proc_hw_params_entry = entry;
611 617 entry = snd_info_create_card_entry(card, "sw_params",
612 if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) { 618 substream->proc_root);
619 if (entry) {
613 snd_info_set_text_ops(entry, substream, 620 snd_info_set_text_ops(entry, substream,
614 snd_pcm_substream_proc_sw_params_read); 621 snd_pcm_substream_proc_sw_params_read);
615 if (snd_info_register(entry) < 0) { 622 if (snd_info_register(entry) < 0) {
@@ -618,8 +625,8 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
618 } 625 }
619 } 626 }
620 substream->proc_sw_params_entry = entry; 627 substream->proc_sw_params_entry = entry;
621 628 entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL);
622 if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) { 629 if (entry) {
623 snd_info_set_text_ops(entry, substream, 630 snd_info_set_text_ops(entry, substream,
624 snd_pcm_substream_proc_status_read); 631 snd_pcm_substream_proc_status_read);
625 if (snd_info_register(entry) < 0) { 632 if (snd_info_register(entry) < 0) {
@@ -1230,7 +1237,8 @@ static void snd_pcm_proc_init(void)
1230{ 1237{
1231 struct snd_info_entry *entry; 1238 struct snd_info_entry *entry;
1232 1239
1233 if ((entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL)) != NULL) { 1240 entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL);
1241 if (entry) {
1234 snd_info_set_text_ops(entry, NULL, snd_pcm_proc_read); 1242 snd_info_set_text_ops(entry, NULL, snd_pcm_proc_read);
1235 if (snd_info_register(entry) < 0) { 1243 if (snd_info_register(entry) < 0) {
1236 snd_info_free_entry(entry); 1244 snd_info_free_entry(entry);