From: Takashi Iwai <tiwai@suse.de>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>,
linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
Vinod Koul <vinod.koul@intel.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [alsa-devel] [PATCH 15/27] ALSA: hda - Use timecounter_initialize interface
Date: Fri, 15 Dec 2017 18:10:09 +0100 [thread overview]
Message-ID: <s5h4lorx6ha.wl-tiwai@suse.de> (raw)
In-Reply-To: <20171215165125.avkz25eek56i5md4@localhost>
On Fri, 15 Dec 2017 17:51:25 +0100,
Richard Cochran wrote:
>
> On Fri, Dec 15, 2017 at 12:10:47PM +0100, Takashi Iwai wrote:
>
> > > - struct cyclecounter *cc = &azx_dev->tc.cc;
>
> > > - cc->read = azx_cc_read;
> > > - cc->mask = CLOCKSOURCE_MASK(32);
>
> > > - cc->mult = 125; /* saturation after 195 years */
> > > - cc->shift = 0;
>
> I want to get away from this mess of open coded structure
> initialization and use a proper functional interface instead.
I agree that a proper functional interface would be better, too.
But not a form like foo(501, 21, 10, 499, 5678).
In C syntax, you may more easily pass a wrong value than open codes.
> > > nsec = 0; /* audio time is elapsed time since trigger */
> > > - timecounter_init(tc, nsec);
> > > + timecounter_initialize(tc,
> > > + azx_cc_read,
> > > + CLOCKSOURCE_MASK(32),
> > > + 125, /* saturation after 195 years */
> > > + 0,
> > > + nsec);
> >
> > Hmm, a function with so many arguments is difficult to remember and is
> > often error-prone. By this transition, it becomes harder to read
> > through.
>
> Please suggest a better way.
I have no good idea ATM, sorry.
Or can we provide simpler versions for covering some defaults? At
least reducing the number of arguments would make things easier.
Takashi
next prev parent reply other threads:[~2017-12-15 17:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
2017-12-15 7:38 ` [PATCH 01/27] timecounter: Make cyclecounter struct part of timecounter struct Sagar Arun Kamble
[not found] ` <1513323522-15021-2-git-send-email-sagar.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-01-08 22:20 ` [Intel-wired-lan] " Brown, Aaron F
2018-01-09 9:01 ` Sagar Arun Kamble
2017-12-15 7:38 ` [PATCH 15/27] ALSA: hda - Use timecounter_initialize interface Sagar Arun Kamble
2017-12-15 11:10 ` [alsa-devel] " Takashi Iwai
2017-12-15 16:51 ` Richard Cochran
2017-12-15 17:10 ` Takashi Iwai [this message]
2017-12-26 7:37 ` Sagar Arun Kamble
2017-12-28 16:49 ` [alsa-devel] " Richard Cochran
2018-01-02 6:03 ` Sagar Arun Kamble
2018-01-02 17:15 ` Pierre-Louis Bossart
2018-01-02 18:21 ` Richard Cochran
2018-01-02 19:53 ` Pierre-Louis Bossart
2018-01-05 10:06 ` [alsa-devel] " Sagar Arun Kamble
2018-01-05 15:43 ` Pierre-Louis Bossart
2018-01-09 10:09 ` Sagar Arun Kamble
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=s5h4lorx6ha.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=sagar.a.kamble@intel.com \
--cc=tglx@linutronix.de \
--cc=vinod.koul@intel.com \
/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