alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Dan Carpenter <dan.carpenter@oracle.com>, shuah@kernel.org
Cc: alsa-devel@alsa-project.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [bug report] media: sound/usb: Use Media Controller API to share media resources
Date: Tue, 8 Jun 2021 11:53:53 -0600	[thread overview]
Message-ID: <3c0f6858-ca94-3cd9-7398-20073dfff7b0@linuxfoundation.org> (raw)
In-Reply-To: <YLeAvT+R22FQ/Eyw@mwanda>

On 6/2/21 6:59 AM, Dan Carpenter wrote:
> Hello Shuah Khan,
> 
> The patch 66354f18fe5f: "media: sound/usb: Use Media Controller API
> to share media resources" from Apr 1, 2019, leads to the following
> static checker warning:
> 
> 	sound/usb/media.c:287 snd_media_device_create()
> 	warn: 'mdev' can also be NULL
> 
> sound/usb/media.c
>     270
>     271          mdev = media_device_usb_allocate(usbdev, KBUILD_MODNAME, THIS_MODULE);
>                  ^^^^
> 
> If CONFIG_MEDIA_CONTROLLER is disabled then "mdev" is NULL.

If CONFIG_MEDIA_CONTROLLER is disabled, this file won't be compiled.
Please see below clause in the Makefile.

sound/usb/Makefile:
snd-usb-audio-$(CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER) += media.o

Also, this select in sound/usb/Kconfig selects appropriate
configs.

select SND_USB_AUDIO_USE_MEDIA_CONTROLLER if MEDIA_CONTROLLER && 
(MEDIA_SUPPORT=y || MEDIA_SUPPORT=SND_USB_AUDIO)

We are good here with the above in place to make sure media.c
code isn't in play when CONFIG_MEDIA_CONTROLLER is disabled.

thanks,
-- Shuah

  reply	other threads:[~2021-06-08 17:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 12:59 [bug report] media: sound/usb: Use Media Controller API to share media resources Dan Carpenter
2021-06-08 17:53 ` Shuah Khan [this message]
2021-06-08 19:03   ` Dan Carpenter
2021-06-08 19:49     ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c0f6858-ca94-3cd9-7398-20073dfff7b0@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.carpenter@oracle.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).