diff options
author | Pierre-Louis Bossart | 2021-04-16 14:11:42 -0500 |
---|---|---|
committer | Mark Brown | 2021-04-19 14:03:31 +0100 |
commit | e2290daefef3afa08135a0a65d4f0ce7fe23d5c0 (patch) | |
tree | 1bd7c15f89039d1919e2c1532d082263743235e5 /.get_maintainer.ignore | |
parent | d3b47a888f0bc66a8590941cfa57ba015b288040 (diff) |
ASoC: soc-core: fix always-false condition
cppcheck warning:
sound/soc/soc-core.c:2784:6: style: Condition '!num_routes' is always
false [knownConditionTrueFalse]
if (!num_routes) {
^
sound/soc/soc-core.c:2777:17: note: Assuming that condition
'num_routes<0' is not redundant
if (num_routes < 0 || num_routes & 1) {
^
sound/soc/soc-core.c:2783:2: note: Compound assignment '/=', assigned
value is 0
num_routes /= 2;
^
sound/soc/soc-core.c:2784:6: note: Condition '!num_routes' is always
false
if (!num_routes) {
^
The documentation for of_property_count_string reads
"
* Returns the number of strings on
* success, -EINVAL if the property does not exist, -ENODATA if property
* does not have a value, and -EILSEQ if the string is not null-terminated
* within the length of the property data.
"
Since the case for num_routes == 0 is not possible, let's remove this
test.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210416191144.27006-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '.get_maintainer.ignore')
0 files changed, 0 insertions, 0 deletions