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: <20171204031319.GW32417@localhost>
Date:   Mon, 4 Dec 2017 08:43:20 +0530
From:   Vinod Koul <vinod.koul@...el.com>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        ALSA <alsa-devel@...a-project.org>, Mark <broonie@...nel.org>,
        Takashi <tiwai@...e.de>, patches.audio@...el.com,
        alan@...ux.intel.com,
        Charles Keepax <ckeepax@...nsource.cirrus.com>,
        Sagar Dharia <sdharia@...eaurora.org>,
        srinivas.kandagatla@...aro.org, plai@...eaurora.org,
        Sudheer Papothi <spapothi@...eaurora.org>
Subject: Re: [alsa-devel] [PATCH v4 08/15] soundwire: Add Slave status
 handling helpers

On Sun, Dec 03, 2017 at 09:07:29PM -0600, Pierre-Louis Bossart wrote:
> On 12/3/17 11:08 AM, Vinod Koul wrote:
> >On Fri, Dec 01, 2017 at 05:36:47PM -0600, Pierre-Louis Bossart wrote:
> >
> >>>+/* called with bus_lock held */
> >>>+static int sdw_get_device_num(struct sdw_slave *slave)
> >>>+{
> >>>+	int bit;
> >>>+
> >>>+	bit = find_first_zero_bit(slave->bus->assigned, SDW_MAX_DEVICES);
> >>>+	if (bit == SDW_MAX_DEVICES) {
> >>>+		bit = -ENODEV;
> >>>+		goto err;
> >>
> >>My brain is starting to fry but is this correct? Bit11 seems like a valid
> >>value. Should it be bit > 15 (assuming bit 12,13,14 are set to avoid using
> >>groups and master)?
> >
> >this is correct. You are confusing SDW concept and API return types!
> >That should be hint for you to start weekend if you didn't do so :D
> >
> >This API returns max value it was provided (last arg) if it doesn't
> >find free bit. That's an indication to caller that we ran out of devices
> >hence ENODEV error!
> 
> Can you just make sure bit11 is included?

yes it is, refer to the masks we set for bit, only 0 and 15 and now 12,13
and 14 will be masked out. So we can get from 1 to 11 both inclusive.

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ