From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: ALSA <alsa-devel@alsa-project.org>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Sudheer Papothi <spapothi@codeaurora.org>,
patches.audio@intel.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
plai@codeaurora.org, LKML <linux-kernel@vger.kernel.org>,
Pierre <pierre-louis.bossart@linux.intel.com>,
Mark <broonie@kernel.org>,
srinivas.kandagatla@linaro.org,
Sagar Dharia <sdharia@codeaurora.org>,
alan@linux.intel.com
Subject: Re: [PATCH v5 04/15] soundwire: Add MIPI DisCo property helpers
Date: Mon, 11 Dec 2017 22:30:22 +0530 [thread overview]
Message-ID: <20171211170022.GT18649@localhost> (raw)
In-Reply-To: <s5hbmj5kzyu.wl-tiwai@suse.de>
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:
> >
> > +static int sdw_slave_read_dpn(struct sdw_slave *slave,
> > + struct sdw_dpn_prop *dpn, int count, int ports, char *type)
> > +{
> ....
> > + nval = fwnode_property_read_u32_array(node,
> > + "mipi-sdw-port-wordlength-configs", NULL, 0);
> > + if (nval > 0)
> > + dpn[i].num_words = nval;
> > +
> > + if (dpn[i].num_words) {
> > + dpn[i].words = devm_kcalloc(&slave->dev, nval,
> > + sizeof(*dpn[i].words), GFP_KERNEL);
>
> Inconsistent checks here: nval or dpn[i].num_words.
Ah yes, we should not do allocation for less that zero case and use it
properly, will fix this and others
>
> > + /* 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.
--
~Vinod
next prev parent reply other threads:[~2017-12-11 16:56 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 [this message]
2017-12-11 17:06 ` Takashi Iwai
2017-12-11 17:18 ` Vinod Koul
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 ` [alsa-devel] " 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=20171211170022.GT18649@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