Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932718AbdLOQvd (ORCPT ); Fri, 15 Dec 2017 11:51:33 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36497 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932508AbdLOQv3 (ORCPT ); Fri, 15 Dec 2017 11:51:29 -0500 X-Google-Smtp-Source: ACJfBougMfMF82MxW2PfTPyWo8/ha8HCzlSTI3bhQUYQDrgOZWoQNG1oUzZpMKZugKRFSGKEflwRRA== Date: Fri, 15 Dec 2017 08:51:25 -0800 From: Richard Cochran To: Takashi Iwai Cc: Sagar Arun Kamble , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Vinod Koul , Thomas Gleixner Subject: Re: [alsa-devel] [PATCH 15/27] ALSA: hda - Use timecounter_initialize interface Message-ID: <20171215165125.avkz25eek56i5md4@localhost> References: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com> <1513323522-15021-16-git-send-email-sagar.a.kamble@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 871 Lines: 30 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. > > 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. Thanks, Richard