[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <57c8a55a-ba27-0b53-e957-657386034e52@linux.intel.com>
Date: Wed, 29 Jun 2022 11:42:22 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
broonie@...nel.org
Cc: alsa-devel@...a-project.org, lgirdwood@...il.com,
linux-kernel@...r.kernel.org, tiwai@...e.com
Subject: Re: [PATCH 2/4] ASoC: codecs: add wsa883x amplifier support
>>> +static int wsa883x_update_status(struct sdw_slave *slave,
>>> + enum sdw_slave_status status)
>>> +{
>>> + struct wsa883x_priv *wsa883x = dev_get_drvdata(&slave->dev);
>>> +
>>> + if (status == SDW_SLAVE_ATTACHED && slave->dev_num > 0)
>>
>> do you actually need to test if slave->dev_num is > 0?
>>
> Few years back I think it was you who asked me to add this check.. :-)
>
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2073074.html
Oops!
My comment was valid in general but at the bus level. With the benefit
of hindsight, I don't think this comment is valid in this callback.
update_status is either called with UNATTACHED, or with ATTACHED/ALERT
after programming dev_num to a value > 0.
It's not wrong to leave the code as is, but it's likely to be an
always-true condition.
Powered by blists - more mailing lists