lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hh8ssgsaw.wl-tiwai@suse.de>
Date:   Fri, 15 Dec 2017 12:10:47 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     Sagar Arun Kamble <sagar.a.kamble@...el.com>
Cc:     linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
        Vinod Koul <vinod.koul@...el.com>,
        Richard Cochran <richardcochran@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [alsa-devel] [PATCH 15/27] ALSA: hda - Use timecounter_initialize  interface

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@...el.com>
> Cc: Richard Cochran <richardcochran@...il.com>
> Cc: Jaroslav Kysela <perex@...ex.cz>
> Cc: Takashi Iwai <tiwai@...e.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Vinod Koul <vinod.koul@...el.com>
> Cc: alsa-devel@...a-project.org
> Cc: linux-kernel@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ