linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	ALSA <alsa-devel@alsa-project.org>, Mark <broonie@kernel.org>,
	Pierre <pierre-louis.bossart@linux.intel.com>,
	patches.audio@intel.com, alan@linux.intel.com,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Sagar Dharia <sdharia@codeaurora.org>,
	srinivas.kandagatla@linaro.org, plai@codeaurora.org,
	Sudheer Papothi <spapothi@codeaurora.org>
Subject: Re: [PATCH v5 04/15] soundwire: Add MIPI DisCo property helpers
Date: Mon, 11 Dec 2017 22:48:31 +0530	[thread overview]
Message-ID: <20171211171831.GV18649@localhost> (raw)
In-Reply-To: <s5hvahdjisp.wl-tiwai@suse.de>

On Mon, Dec 11, 2017 at 06:06:30PM +0100, Takashi Iwai wrote:
> On Mon, 11 Dec 2017 18:00:22 +0100,
> Vinod Koul wrote:
> > 
> > On Mon, Dec 11, 2017 at 05:10:17PM +0100, Takashi Iwai wrote:
> > > On Wed, 06 Dec 2017 16:47:00 +0100,
> > > Vinod Koul wrote:
> > > > 
> > > > +		/* TODO: Read audio mode */
> > > > +
> > > > +		i++;
> > > > +	}
> > > 
> > > Don't we use count argument for a sanity check?
> > 
> > Not really as that iterator runs on each bit:
> > 
> > for_each_set_bit(bit, &addr, 32) {
> > 
> > so it will not go on endlessly and can max out when all the bits being set
> > and stop.
> 
> Yes, that shouldn't happen.  OTOH, only looking at the callee side,
> one may wonder that the possible error would be dpn[] overflows the
> given array size (=count).  Though, looking at both caller and callee,
> one realizes that it shouldn't happen, too.

Right :)

> (But then again wonders why passing count argument at all :)

So we allocate memory for dpn ports by using hweight32(), and then
fill up this memory by reading properties. Count here is used to access
dpn[i] and fill data for each port from firmware and hence incremented
every time..

-- 
~Vinod

  reply	other threads:[~2017-12-11 17:14 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 15:46 [PATCH v5 00/15] soundwire: Add a new SoundWire subsystem Vinod Koul
2017-12-06 15:46 ` [PATCH v5 01/15] Documentation: Add SoundWire summary Vinod Koul
2017-12-06 15:46 ` [PATCH v5 02/15] soundwire: Add SoundWire bus type Vinod Koul
2017-12-13  9:16   ` Greg Kroah-Hartman
2017-12-06 15:46 ` [PATCH v5 03/15] soundwire: Add Master registration Vinod Koul
2017-12-11 16:02   ` Takashi Iwai
2017-12-11 16:44     ` [alsa-devel] " Vinod Koul
2017-12-13  9:16   ` Greg Kroah-Hartman
2017-12-06 15:47 ` [PATCH v5 04/15] soundwire: Add MIPI DisCo property helpers Vinod Koul
2017-12-11 16:10   ` Takashi Iwai
2017-12-11 17:00     ` Vinod Koul
2017-12-11 17:06       ` Takashi Iwai
2017-12-11 17:18         ` Vinod Koul [this message]
2017-12-06 15:47 ` [PATCH v5 05/15] soundwire: Add SoundWire MIPI defined registers Vinod Koul
2017-12-06 15:47 ` [PATCH v5 06/15] soundwire: Add IO transfer Vinod Koul
2017-12-06 15:47 ` [PATCH v5 07/15] regmap: Add SoundWire bus support Vinod Koul
2017-12-06 15:47 ` [PATCH v5 08/15] soundwire: Add Slave status handling helpers Vinod Koul
2017-12-06 15:47 ` [PATCH v5 09/15] soundwire: Add slave status handling Vinod Koul
2017-12-06 15:47 ` [PATCH v5 10/15] soundwire: Add sysfs for SoundWire DisCo properties Vinod Koul
2017-12-13  9:15   ` Greg Kroah-Hartman
2017-12-13  9:54     ` Vinod Koul
2017-12-13 14:31       ` Pierre-Louis Bossart
2017-12-13 16:28       ` Greg Kroah-Hartman
2017-12-13 16:52         ` [alsa-devel] " Vinod Koul
2017-12-13 16:59           ` Greg Kroah-Hartman
2017-12-22  8:26             ` Vinod Koul
2017-12-22  8:33               ` Greg Kroah-Hartman
2017-12-22 11:43                 ` Vinod Koul
2017-12-22 15:20                   ` Greg Kroah-Hartman
2017-12-06 15:47 ` [PATCH v5 11/15] soundwire: cdns: Add cadence library Vinod Koul
2017-12-06 15:47 ` [PATCH v5 12/15] soundwire: cdns: Add sdw_master_ops and IO transfer support Vinod Koul
2017-12-06 15:47 ` [PATCH v5 13/15] soundwire: intel: Add Intel Master driver Vinod Koul
2017-12-06 15:47 ` [PATCH v5 14/15] soundwire: intel: Add Intel init module Vinod Koul
2017-12-06 15:47 ` [PATCH v5 15/15] MAINTAINERS: Add SoundWire entry Vinod Koul
2017-12-06 20:44 ` [PATCH v5 00/15] soundwire: Add a new SoundWire subsystem Philippe Ombredanne
2017-12-07  0:38 ` Pierre-Louis Bossart
2017-12-11 16:30 ` Takashi Iwai
2017-12-13  9:18 ` Greg Kroah-Hartman
2017-12-13  9:57   ` Vinod Koul

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=20171211171831.GV18649@localhost \
    --to=vinod.koul@intel.com \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=plai@codeaurora.org \
    --cc=sdharia@codeaurora.org \
    --cc=spapothi@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).