[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202108251143.1xfx9LqO-lkp@intel.com>
Date: Wed, 25 Aug 2021 11:44:51 +0800
From: kernel test robot <lkp@...el.com>
To: David Rhodes <david.rhodes@...rus.com>
Cc: clang-built-linux@...glegroups.com, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org,
Vijendar Mukunda <Vijendar.Mukunda@....com>
Subject: [agd5f:audio-for-next 135/153] sound/soc/codecs/cs35l41.c:3043:6:
warning: variable 'num_fast_switch' is used uninitialized whenever 'if'
condition is false
tree: https://gitlab.freedesktop.org/agd5f/linux.git audio-for-next
head: b50aaad40c792ec71a1d51622bc50aca608e8b55
commit: 7383306be1da792e3c342ae9a16ea474e6631ebc [135/153] ASoC: cs35l41: Use device_property API instead of of_property
config: arm64-buildonly-randconfig-r006-20210825 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d26000e4cc2bc65e207a84fa26cb6e374d60aa12)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f audio-for-next
git checkout 7383306be1da792e3c342ae9a16ea474e6631ebc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
sound/soc/codecs/cs35l41.c:263:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int ret = 0;
^
sound/soc/codecs/cs35l41.c:491:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int ret = 0;
^
sound/soc/codecs/cs35l41.c:1766:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int ret;
^
>> sound/soc/codecs/cs35l41.c:3043:6: warning: variable 'num_fast_switch' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (np) {
^~
sound/soc/codecs/cs35l41.c:3083:22: note: uninitialized use occurs here
roundup_pow_of_two(num_fast_switch) - 1;
^~~~~~~~~~~~~~~
include/linux/log2.h:176:23: note: expanded from macro 'roundup_pow_of_two'
__builtin_constant_p(n) ? ( \
^
sound/soc/codecs/cs35l41.c:3043:2: note: remove the 'if' if its condition is always true
if (np) {
^~~~~~~~
sound/soc/codecs/cs35l41.c:3037:24: note: initialize the variable 'num_fast_switch' to silence this warning
size_t num_fast_switch;
^
= 0
sound/soc/codecs/cs35l41.c:3293:7: error: no member named 'n_rx_channels' in 'struct wm_adsp'
dsp->n_rx_channels = CS35L41_DSP_N_RX_RATES;
~~~ ^
sound/soc/codecs/cs35l41.c:3294:7: error: no member named 'n_tx_channels' in 'struct wm_adsp'
dsp->n_tx_channels = CS35L41_DSP_N_TX_RATES;
~~~ ^
sound/soc/codecs/cs35l41.c:3297:26: error: too many arguments to function call, expected single argument 'dsp', have 2 arguments
ret = wm_halo_init(dsp, &cs35l41->rate_lock);
~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
sound/soc/codecs/wm_adsp.h:166:5: note: 'wm_halo_init' declared here
int wm_halo_init(struct wm_adsp *dsp);
^
sound/soc/codecs/cs35l41.c:3306:8: error: no member named 'rx_rate_cache' in 'struct wm_adsp'
dsp->rx_rate_cache[i] = 0x1;
~~~ ^
sound/soc/codecs/cs35l41.c:3308:8: error: no member named 'tx_rate_cache' in 'struct wm_adsp'
dsp->tx_rate_cache[i] = 0x1;
~~~ ^
4 warnings and 5 errors generated.
vim +3043 sound/soc/codecs/cs35l41.c
3027
3028
3029
3030 static int cs35l41_handle_pdata(struct device *dev,
3031 struct cs35l41_platform_data *pdata,
3032 struct cs35l41_private *cs35l41)
3033 {
3034 struct device_node *np = dev->of_node;
3035 unsigned int val;
3036 int ret;
3037 size_t num_fast_switch;
3038 struct cs35l41_classh_cfg *classh_config = &pdata->classh_config;
3039 struct cs35l41_irq_cfg *irq_gpio1_config = &pdata->irq_config1;
3040 struct cs35l41_irq_cfg *irq_gpio2_config = &pdata->irq_config2;
3041 unsigned int i;
3042
> 3043 if (np) {
3044 cs35l41->dt_name = devm_kstrdup_const(cs35l41->dev, np->name,
3045 GFP_KERNEL);
3046
3047 ret = of_property_count_strings(np, "cirrus,fast-switch");
3048 if (ret < 0) {
3049 /*
3050 * Device tree does not provide file name.
3051 * Use default value
3052 */
3053 num_fast_switch = ARRAY_SIZE(cs35l41_fast_switch_text);
3054 cs35l41->fast_switch_enum.items =
3055 ARRAY_SIZE(cs35l41_fast_switch_text);
3056 cs35l41->fast_switch_enum.texts = cs35l41_fast_switch_text;
3057 cs35l41->fast_switch_names = cs35l41_fast_switch_text;
3058 } else {
3059 /* Device tree provides file name */
3060 num_fast_switch = (size_t)ret;
3061 dev_info(dev, "num_fast_switch:%zu\n", num_fast_switch);
3062 cs35l41->fast_switch_names =
3063 devm_kmalloc(dev, num_fast_switch * sizeof(char *),
3064 GFP_KERNEL);
3065 if (!cs35l41->fast_switch_names)
3066 return -ENOMEM;
3067 of_property_read_string_array(np, "cirrus,fast-switch",
3068 cs35l41->fast_switch_names,
3069 num_fast_switch);
3070 for (i = 0; i < num_fast_switch; i++) {
3071 dev_info(dev, "%d:%s\n", i,
3072 cs35l41->fast_switch_names[i]);
3073 }
3074 cs35l41->fast_switch_enum.items = num_fast_switch;
3075 cs35l41->fast_switch_enum.texts = cs35l41->fast_switch_names;
3076 }
3077 }
3078
3079 cs35l41->fast_switch_enum.reg = SND_SOC_NOPM;
3080 cs35l41->fast_switch_enum.shift_l = 0;
3081 cs35l41->fast_switch_enum.shift_r = 0;
3082 cs35l41->fast_switch_enum.mask =
3083 roundup_pow_of_two(num_fast_switch) - 1;
3084
3085 pdata->right_channel = device_property_read_bool(dev,
3086 "cirrus,right-channel-amp");
3087 pdata->sclk_frc = device_property_read_bool(dev,
3088 "cirrus,sclk-force-output");
3089 pdata->lrclk_frc = device_property_read_bool(dev,
3090 "cirrus,lrclk-force-output");
3091 pdata->amp_gain_zc = device_property_read_bool(dev,
3092 "cirrus,amp-gain-zc");
3093
3094 pdata->invert_pcm = device_property_read_bool(dev,
3095 "cirrus,invert-pcm");
3096 pdata->shared_boost = SHARED_BOOST_DISABLED;
3097 if (device_property_read_bool(dev, "cirrus,shared-boost-active"))
3098 pdata->shared_boost = SHARED_BOOST_ACTIVE;
3099 if (device_property_read_bool(dev, "cirrus,shared-boost-passive"))
3100 pdata->shared_boost = SHARED_BOOST_PASSIVE;
3101
3102 pdata->fwname_use_revid = device_property_read_bool(dev,
3103 "cirrus,fwname-use-revid");
3104
3105 if (device_property_read_u32(dev, "cirrus,temp-warn_threshold", &val) >= 0)
3106 pdata->temp_warn_thld = val | CS35L41_VALID_PDATA;
3107
3108 ret = device_property_read_u32(dev, "cirrus,boost-ctl-millivolt", &val);
3109 if (ret >= 0) {
3110 if (val < 2550 || val > 11000) {
3111 dev_err(dev,
3112 "Invalid Boost Voltage %u mV\n", val);
3113 return -EINVAL;
3114 }
3115 pdata->bst_vctrl = ((val - 2550) / 100) + 1;
3116 }
3117
3118 ret = device_property_read_u32(dev, "cirrus,boost-peak-milliamp", &val);
3119 if (ret >= 0)
3120 pdata->bst_ipk = val;
3121
3122 ret = device_property_read_u32(dev, "cirrus,boost-ind-nanohenry", &val);
3123 if (ret >= 0)
3124 pdata->bst_ind = val;
3125
3126 ret = device_property_read_u32(dev, "cirrus,boost-cap-microfarad", &val);
3127 if (ret >= 0)
3128 pdata->bst_cap = val;
3129
3130 ret = device_property_read_u32(dev, "cirrus,asp-sdout-hiz", &val);
3131 if (ret >= 0)
3132 pdata->dout_hiz = val;
3133 else
3134 pdata->dout_hiz = -1;
3135
3136 pdata->dsp_ng_enable = device_property_read_bool(dev,
3137 "cirrus,dsp-noise-gate-enable");
3138 if (device_property_read_u32(dev,
3139 "cirrus,dsp-noise-gate-threshold", &val) >= 0)
3140 pdata->dsp_ng_pcm_thld = val | CS35L41_VALID_PDATA;
3141 if (device_property_read_u32(dev, "cirrus,dsp-noise-gate-delay", &val) >= 0)
3142 pdata->dsp_ng_delay = val | CS35L41_VALID_PDATA;
3143
3144 if (device_property_read_u32(dev, "cirrus,hw-noise-gate-select", &val) >= 0)
3145 pdata->hw_ng_sel = val | CS35L41_VALID_PDATA;
3146 if (device_property_read_u32(dev,
3147 "cirrus,hw-noise-gate-threshold", &val) >= 0)
3148 pdata->hw_ng_thld = val | CS35L41_VALID_PDATA;
3149 if (device_property_read_u32(dev, "cirrus,hw-noise-gate-delay", &val) >= 0)
3150 pdata->hw_ng_delay = val | CS35L41_VALID_PDATA;
3151
3152 classh_config->classh_algo_enable =
3153 device_property_read_bool(dev, "cirrus,classh-internal-algo");
3154
3155 if (classh_config->classh_algo_enable) {
3156 classh_config->classh_bst_override =
3157 device_property_read_bool(dev,
3158 "cirrus,classh-bst-override");
3159
3160 ret = device_property_read_u32(dev,
3161 "cirrus,classh-bst-max-limit",
3162 &val);
3163 if (ret >= 0) {
3164 val |= CS35L41_VALID_PDATA;
3165 classh_config->classh_bst_max_limit = val;
3166 }
3167
3168 ret = device_property_read_u32(dev, "cirrus,classh-mem-depth",
3169 &val);
3170 if (ret >= 0) {
3171 val |= CS35L41_VALID_PDATA;
3172 classh_config->classh_mem_depth = val;
3173 }
3174
3175 ret = device_property_read_u32(dev,
3176 "cirrus,classh-release-rate", &val);
3177 if (ret >= 0)
3178 classh_config->classh_release_rate = val;
3179
3180 ret = device_property_read_u32(dev, "cirrus,classh-headroom",
3181 &val);
3182 if (ret >= 0) {
3183 val |= CS35L41_VALID_PDATA;
3184 classh_config->classh_headroom = val;
3185 }
3186
3187 ret = device_property_read_u32(dev,
3188 "cirrus,classh-wk-fet-delay", &val);
3189 if (ret >= 0) {
3190 val |= CS35L41_VALID_PDATA;
3191 classh_config->classh_wk_fet_delay = val;
3192 }
3193
3194 ret = device_property_read_u32(dev,
3195 "cirrus,classh-wk-fet-thld", &val);
3196 if (ret >= 0)
3197 classh_config->classh_wk_fet_thld = val;
3198 }
3199
3200 /* GPIO1 Pin Config */
3201 irq_gpio1_config->irq_pol_inv = device_property_read_bool(dev,
3202 "cirrus,gpio1-polarity-invert");
3203 irq_gpio1_config->irq_out_en = device_property_read_bool(dev,
3204 "cirrus,gpio1-output-enable");
3205 ret = device_property_read_u32(dev, "cirrus,gpio1-src-select",
3206 &val);
3207 if (ret >= 0) {
3208 val |= CS35L41_VALID_PDATA;
3209 irq_gpio1_config->irq_src_sel = val;
3210 }
3211
3212 /* GPIO2 Pin Config */
3213 irq_gpio2_config->irq_pol_inv = device_property_read_bool(dev,
3214 "cirrus,gpio2-polarity-invert");
3215 irq_gpio2_config->irq_out_en = device_property_read_bool(dev,
3216 "cirrus,gpio2-output-enable");
3217 ret = device_property_read_u32(dev, "cirrus,gpio2-src-select",
3218 &val);
3219 if (ret >= 0) {
3220 val |= CS35L41_VALID_PDATA;
3221 irq_gpio2_config->irq_src_sel = val;
3222 }
3223
3224 pdata->hibernate_enable = device_property_read_bool(dev,
3225 "cirrus,hibernate-enable");
3226
3227 return 0;
3228 }
3229
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (40069 bytes)
Powered by blists - more mailing lists