Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp367998ybe; Wed, 4 Sep 2019 00:38:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHyxP+5XfmqK1rhz8W4VUmcsgBv5SpT4ObF3BGGzr8r6TgATJi4hSkfpDS8aE63jaX9eMX X-Received: by 2002:aa7:9ab6:: with SMTP id x22mr4864623pfi.15.1567582684830; Wed, 04 Sep 2019 00:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567582684; cv=none; d=google.com; s=arc-20160816; b=nuuKRIQj0LwBz/kPq6aJ3JGDtZglnhE8QcZxiUQnf0FPK8EIixgtBKdQM5AP4I1Uf5 WXSB1wwkz2QyBRSWmRkJURiIFmDmzqT5gqQ3rQaEnnzh0S3dL/A4KolnfKDQ6+itzAYR eVr7MC60iFcF0ki32uM4ObyCgV+ksXjki2MR4k67ihPl+HsC/IhuH0LsBsolYu4VFEUe PPpdwvyBNqLzPa14ujLVAqjozpq+nnzJnP1l1ICO8+XdlJ+l/4CMniDtpZOtKzQvt/Yz Iy0bjAfIqZ2lWTMJ0l63pQdxFvnXvLJpWMaiZ764YZm0fpMMyc4SI3dM4DZkbfBOX5/7 ejbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hfyjDQfaWNZxc2trdxHBz/eAt+egIVUrm4ppOQXkLyc=; b=VJMYfzt1i8dToGls66PW3w4ie2bLbAUidSTngf3t8xYXb0JHD2pGZIdFXxMI8UXwif RX5N5TTb8tiY/CjcsV9gAU3TuvLX4Z9XuK6qAhmxq8xNhMzQY6zMKRz5C9oGaxeypxfI 1ChP+BTrHGqBqJjO0LFWRrHLSPyN3uijWOHNY0tx2zrg16z/6xknE9Fs6iiZm2+rn/hZ 2NxKfmec+jqH9yw189aAnrHtyjFvsDUwL3Jz/bYSIwQAMhyHqyGp8lL/DE02Z1pirjnj nBbgv//obIGtjYr2emZrffIVUPSldVtLmbWWNJiJfTmpBsH0m/O7/J1DG9f0FIdZzQ72 O3ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XSzxaQwe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q25si16695128pgv.114.2019.09.04.00.37.48; Wed, 04 Sep 2019 00:38:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XSzxaQwe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729089AbfIDHg7 (ORCPT + 99 others); Wed, 4 Sep 2019 03:36:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:41938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbfIDHg6 (ORCPT ); Wed, 4 Sep 2019 03:36:58 -0400 Received: from localhost (unknown [122.182.201.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1A4B22CF7; Wed, 4 Sep 2019 07:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567582617; bh=9tMEcYhnS4XXxNd9Fq6cg1vvF93E3PyA0c/S3pkKcdk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XSzxaQweCp8UhjDZhBkcedCz7pMSLZKAX3ePxOXWUuITOZeqlNEPfeG+n9r1e1jPJ YCXo4f2BLj6ECIANHnU2q37o9hS2HWrlnLnfPPXTiKgvtyeQXX3r4ixcTRka06JsSg xLedyl45/h64FjeKNQvZy+ZRB8RcMeBCqZdZt6mU= Date: Wed, 4 Sep 2019 13:05:49 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: Guennadi Liakhovetski , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Bard liao , Rander Wang , Ranjani Sridharan , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Zhu Yingjiang , YueHaibing , Kai Vehmanen , Arnd Bergmann Subject: Re: [RFC PATCH 4/5] ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks Message-ID: <20190904073549.GL2672@vkoul-mobl> References: <20190821201720.17768-1-pierre-louis.bossart@linux.intel.com> <20190821201720.17768-5-pierre-louis.bossart@linux.intel.com> <20190822071835.GA30262@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-08-19, 08:53, Pierre-Louis Bossart wrote: > Thanks for the review Guennadi > > > > +static int sdw_config_stream(void *arg, void *s, void *dai, > > > + void *params, int link_id, int alh_stream_id) > > > > I realise, that these function prototypes aren't being introduced by these > > patches, but just wondering whether such overly generic prototype is really > > a good idea here, whether some of those "void *" pointers could be given > > real types. The first one could be "struct device *" etc. > > In this case the 'arg' parameter is actually a private 'struct snd_sof_dev', > as shown below [1]. We probably want to keep this relatively opaque, this is > a context that doesn't need to be exposed to the SoundWire code. This does look bit ugly. > The dai and params are indeed cases where we could use stronger types, they > are snd_soc_dai and hw_params respectively. I don't recall why the existing > code is this way, Vinod and Sanyog may have the history of this. Yes we wanted to decouple the sdw and audio bits that is the reason why none of the audio types are used here, but I think it should be revisited and perhaps made as: sdw_config_stream(struct device *sdw, struct sdw_callback_ctx *ctx) where the callback context contains all the other args. That would make it look lot neater too and of course use real structs if possible -- ~Vinod