All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org
Subject: Re: ALSA: tons of false positives because of snd_ctl_find_id()
Date: Fri, 2 Feb 2018 12:57:28 +0300	[thread overview]
Message-ID: <20180202095728.4e2pfy2lwcprwpyb@mwanda> (raw)
In-Reply-To: <43521b22-dfda-ff5f-5857-0d1a8ae639f5@sakamocchi.jp>

On Fri, Feb 02, 2018 at 06:07:14PM +0900, Takashi Sakamoto wrote:
> 
> In a design of ALSA control core, each element can be pointed according
> to data of 'struct snd_ctl_elem_id'. There're two independent ways to
> indicate arbitrary element:
>  1. by 'numerical ID' (.numid)
>  2. by a combination of 'interface' (.iface), 'device' (.device),
>     'sub device' (.subdevice), 'name' (.name) and 'index' (.index).
> 
> For our information, in ALSA control core, some elements with the same
> attributes are managed by data of 'struct snd_kcontrol'. I call it as
> 'element set'. The value of '.index' represents offset from the first
> element in the element set for a target element.
> 
> I don't get your concern clearly. But it's my pleasure that the above
> information will help you if you missed the two ways.
> 

Right.  Thanks.  I understood all that...

I've actually figured out a hack that will probably work fine to fix my
issue.  Smatch provides a way to hand edit the cross function DB:
http://repo.or.cz/smatch.git/blob/HEAD:/smatch_data/db/fixup_kernel.sh
I can probably solve this by adding a few lines of code to that file.
I'm testing it now.

What I was trying to say was even though we don't need to check .index
since we're not using it, it would simplify static analysis if we would
would set it to zero.  It shouldn't hurt anything since we're not going
to use it.

Anyway, leave it for now because I've got this easier hack around.

regards,
dan carpenter

  reply	other threads:[~2018-02-02  9:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  8:29 ALSA: tons of false positives because of snd_ctl_find_id() Dan Carpenter
2018-02-02  9:07 ` Takashi Sakamoto
2018-02-02  9:57   ` Dan Carpenter [this message]
2018-02-12 13:20     ` Takashi Iwai

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=20180202095728.4e2pfy2lwcprwpyb@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=o-takashi@sakamocchi.jp \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.