mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	Vinod Koul <vinod.koul@intel.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [alsa-devel] [PATCH 15/27] ALSA: hda - Use timecounter_initialize  interface
Date: Fri, 15 Dec 2017 12:10:47 +0100	[thread overview]
Message-ID: <s5hh8ssgsaw.wl-tiwai@suse.de> (raw)
In-Reply-To: <1513323522-15021-16-git-send-email-sagar.a.kamble@intel.com>

On Fri, 15 Dec 2017 08:38:30 +0100,
Sagar Arun Kamble wrote:
> 
> With new interface timecounter_initialize we can initialize timecounter
> fields and underlying cyclecounter together. Update azx timecounter
> init with this new function.
> 
> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Richard Cochran <richardcochran@gmail.com>
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: alsa-devel@alsa-project.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  sound/hda/hdac_stream.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
> index 9426c1a..ad91dde 100644
> --- a/sound/hda/hdac_stream.c
> +++ b/sound/hda/hdac_stream.c
> @@ -477,12 +477,8 @@ static void azx_timecounter_init(struct hdac_stream *azx_dev,
>  				 bool force, u64 last)
>  {
>  	struct timecounter *tc = &azx_dev->tc;
> -	struct cyclecounter *cc = &azx_dev->tc.cc;
>  	u64 nsec;
>  
> -	cc->read = azx_cc_read;
> -	cc->mask = CLOCKSOURCE_MASK(32);
> -
>  	/*
>  	 * Converting from 24 MHz to ns means applying a 125/3 factor.
>  	 * To avoid any saturation issues in intermediate operations,
> @@ -493,11 +489,13 @@ static void azx_timecounter_init(struct hdac_stream *azx_dev,
>  	 * overflows occur after about 4 hours or less, not a option.
>  	 */
>  
> -	cc->mult = 125; /* saturation after 195 years */
> -	cc->shift = 0;
> -
>  	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.


thanks,

Takashi

  reply	other threads:[~2017-12-15 11:10 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15  7:38 [PATCH 00/27] timecounter/cyclecounter struct/interface update Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 01/27] timecounter: Make cyclecounter struct part of timecounter struct Sagar Arun Kamble
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 02/27] timecounter: Introduce timecounter_initialize to update timecounter and cyclecounter Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 03/27] microblaze: Use timecounter_initialize interface Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 04/27] clocksource/arm_arch_timer: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 05/27] amd-xgbe: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 06/27] bnx2x: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 07/27] fec: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 08/27] e1000e: " Sagar Arun Kamble
2018-01-06  4:31   ` [Intel-wired-lan] " Brown, Aaron F
2017-12-15  7:38 ` [PATCH 09/27] igb: " Sagar Arun Kamble
2018-01-06  5:14   ` [Intel-wired-lan] " Brown, Aaron F
2017-12-15  7:38 ` [PATCH 10/27] ixgbe: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 11/27] net/mlx4: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 12/27] net/mlx5: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 13/27] qede: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 14/27] net: cpts: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 15/27] ALSA: hda - " Sagar Arun Kamble
2017-12-15 11:10   ` Takashi Iwai [this message]
2017-12-15 16:51     ` [alsa-devel] " Richard Cochran
2017-12-15 17:10       ` Takashi Iwai
2017-12-26  7:37         ` Sagar Arun Kamble
2017-12-28 16:49           ` 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                     ` Sagar Arun Kamble
2018-01-05 15:43                       ` Pierre-Louis Bossart
2018-01-09 10:09                         ` Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 16/27] timecounter: Introduce timecounter_reset Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 17/27] amd-xgbe: Use timecounter_reset interface Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 18/27] bnx2x: " Sagar Arun Kamble
2017-12-18 14:13   ` Kalluru, Sudarsana
2017-12-15  7:38 ` [PATCH 19/27] net: fec: ptp: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 20/27] e1000e: " Sagar Arun Kamble
2018-01-06  4:30   ` [Intel-wired-lan] " Brown, Aaron F
2017-12-15  7:38 ` [PATCH 21/27] igb: " Sagar Arun Kamble
2018-01-06  4:33   ` [Intel-wired-lan] " Brown, Aaron F
2017-12-15  7:38 ` [PATCH 22/27] ixgbe: " Sagar Arun Kamble
2018-01-06  4:33   ` [Intel-wired-lan] " Brown, Aaron F
2018-01-06  5:11   ` Brown, Aaron F
2017-12-15  7:38 ` [PATCH 23/27] net/mlx4: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 24/27] net/mlx5: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 25/27] qede: " Sagar Arun Kamble
2017-12-18 14:13   ` Kalluru, Sudarsana
2017-12-15  7:38 ` [PATCH 26/27] net: cpts: " Sagar Arun Kamble
2017-12-15  7:38 ` [PATCH 27/27] timecounter: Remove timecounter_init 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=s5hh8ssgsaw.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

Powered by JetHome