ALSA: core: init: use DECLARE_COMPLETION_ONSTACK() macro
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 2 Sep 2020 21:21:23 +0000 (16:21 -0500)
committerTakashi Iwai <tiwai@suse.de>
Thu, 3 Sep 2020 07:26:38 +0000 (09:26 +0200)
Follow recommendation in Documentation/scheduler/completion.rst and use
macro to declare local 'struct completion'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/init.c

index 0478847..764dbe6 100644 (file)
@@ -519,10 +519,9 @@ EXPORT_SYMBOL(snd_card_free_when_closed);
  */
 int snd_card_free(struct snd_card *card)
 {
-       struct completion released;
+       DECLARE_COMPLETION_ONSTACK(released);
        int ret;
 
-       init_completion(&released);
        card->release_completion = &released;
        ret = snd_card_free_when_closed(card);
        if (ret)