From: Takashi Iwai Date: Sun, 23 May 2021 09:09:18 +0000 (+0200) Subject: ALSA: control: Minor optimization for SNDRV_CTL_IOCTL_POWER_STATE X-Git-Tag: v5.15~819^2~9^2~226^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=968bb2baec60757ae86b4ee937561f5815488044;p=platform%2Fkernel%2Flinux-starfive.git ALSA: control: Minor optimization for SNDRV_CTL_IOCTL_POWER_STATE Long long time ago, before the proper PM framework was introduced, it was still possible to reach SNDRV_CTL_IOCTL_POWER ioctl during the power off state. This ioctl existed as a main control for the suspend resume state in the past, but the feature was already dropped along with the standard PM framework. Now the read part, SNDRV_IOCTL_POWER_STATE ioctl, returns practically always D0, and we can do some minor optimization there. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20210523090920.15345-5-tiwai@suse.de Signed-off-by: Takashi Iwai --- diff --git a/sound/core/control.c b/sound/core/control.c index 7fe9013..a25c0d6 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1817,11 +1817,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg case SNDRV_CTL_IOCTL_POWER: return -ENOPROTOOPT; case SNDRV_CTL_IOCTL_POWER_STATE: -#ifdef CONFIG_PM - return put_user(card->power_state, ip) ? -EFAULT : 0; -#else return put_user(SNDRV_CTL_POWER_D0, ip) ? -EFAULT : 0; -#endif } down_read(&snd_ioctl_rwsem); list_for_each_entry(p, &snd_control_ioctls, list) {