sound/soc/codecs/tlv320adcx140.c:751:2: note: in expansion of macro 'if'
From: kbuild test robot
Date: Tue May 19 2020 - 05:03:07 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 642b151f45dd54809ea00ecd3976a56c1ec9b53d
commit: 2e4249f58074ec93746df3a902d1835b7edfef49 ASoC: tlv320adcx140: Fix mic_bias and vref device tree verification
date: 3 months ago
config: nds32-randconfig-m001-20200519 (attached as .config)
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
sound/soc/codecs/tlv320adcx140.c: In function 'adcx140_reset':
sound/soc/codecs/tlv320adcx140.c:551:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
551 | int ret = 0;
| ^~~
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/module.h:12,
from sound/soc/codecs/tlv320adcx140.c:5:
sound/soc/codecs/tlv320adcx140.c: In function 'adcx140_codec_probe':
sound/soc/codecs/tlv320adcx140.c:751:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
751 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
| ^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
>> sound/soc/codecs/tlv320adcx140.c:751:2: note: in expansion of macro 'if'
751 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
| ^~
sound/soc/codecs/tlv320adcx140.c:751:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
751 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
| ^
include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
>> sound/soc/codecs/tlv320adcx140.c:751:2: note: in expansion of macro 'if'
751 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
| ^~
sound/soc/codecs/tlv320adcx140.c:751:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
751 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
| ^
include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
69 | (cond) ? | ^~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
>> sound/soc/codecs/tlv320adcx140.c:751:2: note: in expansion of macro 'if'
751 | if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
| ^~
sound/soc/codecs/tlv320adcx140.c:762:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
762 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
| ^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
sound/soc/codecs/tlv320adcx140.c:762:2: note: in expansion of macro 'if'
762 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
| ^~
sound/soc/codecs/tlv320adcx140.c:762:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
762 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
| ^
include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~
sound/soc/codecs/tlv320adcx140.c:762:2: note: in expansion of macro 'if'
762 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
| ^~
sound/soc/codecs/tlv320adcx140.c:762:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
762 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
| ^
include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
69 | (cond) ? | ^~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
sound/soc/codecs/tlv320adcx140.c:762:2: note: in expansion of macro 'if'
762 | if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
| ^~
vim +/if +751 sound/soc/codecs/tlv320adcx140.c
737
738 static int adcx140_codec_probe(struct snd_soc_component *component)
739 {
740 struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component);
741 int sleep_cfg_val = ADCX140_WAKE_DEV;
742 u8 bias_source;
743 u8 vref_source;
744 int ret;
745
746 ret = device_property_read_u8(adcx140->dev, "ti,mic-bias-source",
747 &bias_source);
748 if (ret)
749 bias_source = ADCX140_MIC_BIAS_VAL_VREF;
750
> 751 if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
752 bias_source > ADCX140_MIC_BIAS_VAL_AVDD) {
753 dev_err(adcx140->dev, "Mic Bias source value is invalid\n");
754 return -EINVAL;
755 }
756
757 ret = device_property_read_u8(adcx140->dev, "ti,vref-source",
758 &vref_source);
759 if (ret)
760 vref_source = ADCX140_MIC_BIAS_VREF_275V;
761
762 if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||
763 vref_source > ADCX140_MIC_BIAS_VREF_1375V) {
764 dev_err(adcx140->dev, "Mic Bias source value is invalid\n");
765 return -EINVAL;
766 }
767
768 bias_source |= vref_source;
769
770 ret = adcx140_reset(adcx140);
771 if (ret)
772 goto out;
773
774 if(adcx140->supply_areg == NULL)
775 sleep_cfg_val |= ADCX140_AREG_INTERNAL;
776
777 ret = regmap_write(adcx140->regmap, ADCX140_SLEEP_CFG, sleep_cfg_val);
778 if (ret) {
779 dev_err(adcx140->dev, "setting sleep config failed %d\n", ret);
780 goto out;
781 }
782
783 /* 8.4.3: Wait >= 1ms after entering active mode. */
784 usleep_range(1000, 100000);
785
786 ret = regmap_update_bits(adcx140->regmap, ADCX140_BIAS_CFG,
787 ADCX140_MIC_BIAS_VAL_MSK |
788 ADCX140_MIC_BIAS_VREF_MSK, bias_source);
789 if (ret)
790 dev_err(adcx140->dev, "setting MIC bias failed %d\n", ret);
791 out:
792 return ret;
793 }
794
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip