All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: "Guedes, Andre" <andre.guedes@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Girdwood, Liam R" <liam.r.girdwood@intel.com>
Subject: Re: [PATCH - AAF PCM plugin 3/7] aaf: Implement Playback mode support
Date: Thu, 11 Oct 2018 10:00:11 +0200	[thread overview]
Message-ID: <s5hr2gwdib8.wl-tiwai@suse.de> (raw)
In-Reply-To: <d1524938-2bb1-89ab-a03f-0822908c71f5@sakamocchi.jp>

On Thu, 11 Oct 2018 09:45:07 +0200,
Takashi Sakamoto wrote:
> 
> On Oct 11 2018 16:31, Takashi Iwai wrote:
> > On Wed, 10 Oct 2018 23:27:29 +0200,
> > Guedes, Andre wrote:
> >>
> >> On Wed, 2018-10-10 at 12:34 +0200, Takashi Iwai wrote:
> >>>> +static int aaf_set_hw_constraint(snd_pcm_aaf_t *aaf)
> >>>> +{
> >>>> +     int res;
> >>>> +     snd_pcm_ioplug_t *io = &aaf->io;
> >>>> +     const unsigned int accesses[] = {
> >>>> +             SND_PCM_ACCESS_RW_INTERLEAVED,
> >>>> +     };
> >>>> +     const unsigned int formats[] = {
> >>>> +             SND_PCM_FORMAT_S16_BE,
> >>>> +             SND_PCM_FORMAT_S24_3BE,
> >>>> +             SND_PCM_FORMAT_S32_BE,
> >>>> +             SND_PCM_FORMAT_FLOAT_BE,
> >>>> +     };
> >>>> +     const unsigned int rates[] = {
> >>>> +             8000,
> >>>> +             16000,
> >>>> +             24000,
> >>>> +             32000,
> >>>> +             44100,
> >>>> +             48000,
> >>>> +             88200,
> >>>> +             96000,
> >>>> +             176400,
> >>>> +             192000,
> >>>> +     };
> >>>
> >>> Use static arrays for the above.
> >>
> >> It isn't clear to me what is the point in allocating these variables in
> >> the global scope. May I ask what is the benefit in adding the 'static'
> >> modifier to these local variables?
> >
> > Yes.
> 
> In this case, it's not relevant to access scope.
> 
> Just with 'const' qualifier, the symbol allocates in .text section of
> ELF binary. With additional 'static' qualifier, the symbol allocates
> in .rodata section.
> 
> In loading, symbol in .rodata section locates in segments of VMA with
> 'read-only' flag. This brings safety from several bugs such as buffer
> over-run.

OK, then scratch my comments.


thanks,

Takashi

  reply	other threads:[~2018-10-11  8:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 23:45 [PATCH - AAF PCM plugin 0/7] Introduce AVTP Audio Format (AAF) plugin Andre Guedes
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 1/7] aaf: Introduce plugin skeleton Andre Guedes
2018-10-10 10:27   ` Takashi Iwai
2018-10-10 21:22     ` Guedes, Andre
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 2/7] aaf: Load configuration parameters Andre Guedes
2018-10-10 10:29   ` Takashi Iwai
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 3/7] aaf: Implement Playback mode support Andre Guedes
2018-10-10 10:34   ` Takashi Iwai
2018-10-10 21:27     ` Guedes, Andre
2018-10-11  7:31       ` Takashi Iwai
2018-10-11  7:45         ` Takashi Sakamoto
2018-10-11  8:00           ` Takashi Iwai [this message]
2018-10-11 19:53             ` Guedes, Andre
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 4/7] aaf: Prepare for Capture " Andre Guedes
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 5/7] aaf: Implement " Andre Guedes
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 6/7] aaf: Implement dump() ioplug callback Andre Guedes
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 7/7] aaf: Add support for direct read/write transfers Andre Guedes
2018-10-10 10:25 ` [PATCH - AAF PCM plugin 0/7] Introduce AVTP Audio Format (AAF) plugin Takashi Iwai
2018-10-10 21:19   ` Guedes, Andre
2018-10-22 16:51     ` Pierre-Louis Bossart
2018-10-23 20:01       ` Guedes, Andre

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=s5hr2gwdib8.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andre.guedes@intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=o-takashi@sakamocchi.jp \
    /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.