All of lore.kernel.org
 help / color / mirror / Atom feed
* [agd5f:audio-for-next 138/153] sound/soc/codecs/cs35l41.c:3085 cs35l41_handle_pdata() error: uninitialized symbol 'num_fast_switch'.
@ 2021-08-30 20:32 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-30 20:32 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 17840 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: David Rhodes <david.rhodes@cirrus.com>
CC: Vijendar Mukunda <Vijendar.Mukunda@amd.com>

Hi David,

First bad commit (maybe != root cause):

tree:   https://gitlab.freedesktop.org/agd5f/linux.git audio-for-next
head:   b50aaad40c792ec71a1d51622bc50aca608e8b55
commit: ade0b6be8174d71acc3fba2af945ccd4a89cfd3c [138/153] ASoC: cs35l41: Remove DSP rate cache
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: microblaze-randconfig-m031-20210830 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
sound/soc/codecs/cs35l41.c:3085 cs35l41_handle_pdata() error: uninitialized symbol 'num_fast_switch'.

vim +/num_fast_switch +3085 sound/soc/codecs/cs35l41.c

132d6b55708631 David Rhodes   2017-06-14  3027  
132d6b55708631 David Rhodes   2017-06-14  3028  
132d6b55708631 David Rhodes   2017-06-14  3029  
7383306be1da79 David Rhodes   2021-04-27  3030  static int cs35l41_handle_pdata(struct device *dev,
3eadefdd1ff115 Li Xu          2018-10-23  3031  				  struct cs35l41_platform_data *pdata,
3eadefdd1ff115 Li Xu          2018-10-23  3032  				  struct cs35l41_private *cs35l41)
132d6b55708631 David Rhodes   2017-06-14  3033  {
132d6b55708631 David Rhodes   2017-06-14  3034  	struct device_node *np = dev->of_node;
132d6b55708631 David Rhodes   2017-06-14  3035  	unsigned int val;
132d6b55708631 David Rhodes   2017-06-14  3036  	int ret;
3eadefdd1ff115 Li Xu          2018-10-23  3037  	size_t	num_fast_switch;
605c4fa0434f38 David Rhodes   2020-03-20  3038  	struct cs35l41_classh_cfg *classh_config = &pdata->classh_config;
605c4fa0434f38 David Rhodes   2020-03-20  3039  	struct cs35l41_irq_cfg *irq_gpio1_config = &pdata->irq_config1;
605c4fa0434f38 David Rhodes   2020-03-20  3040  	struct cs35l41_irq_cfg *irq_gpio2_config = &pdata->irq_config2;
3eadefdd1ff115 Li Xu          2018-10-23  3041  	unsigned int i;
132d6b55708631 David Rhodes   2017-06-14  3042  
7383306be1da79 David Rhodes   2021-04-27  3043  	if (np) {
080d496d7317a9 Adam Brickman  2020-10-05  3044  		cs35l41->dt_name = devm_kstrdup_const(cs35l41->dev, np->name,
080d496d7317a9 Adam Brickman  2020-10-05  3045  					      GFP_KERNEL);
080d496d7317a9 Adam Brickman  2020-10-05  3046  
3eadefdd1ff115 Li Xu          2018-10-23  3047  		ret = of_property_count_strings(np, "cirrus,fast-switch");
3eadefdd1ff115 Li Xu          2018-10-23  3048  		if (ret < 0) {
3eadefdd1ff115 Li Xu          2018-10-23  3049  			/*
775a943befe860 David Rhodes   2020-07-14  3050  			 * Device tree does not provide file name.
3eadefdd1ff115 Li Xu          2018-10-23  3051  			 * Use default value
3eadefdd1ff115 Li Xu          2018-10-23  3052  			 */
3eadefdd1ff115 Li Xu          2018-10-23  3053  			num_fast_switch = ARRAY_SIZE(cs35l41_fast_switch_text);
3eadefdd1ff115 Li Xu          2018-10-23  3054  			cs35l41->fast_switch_enum.items	=
3eadefdd1ff115 Li Xu          2018-10-23  3055  				ARRAY_SIZE(cs35l41_fast_switch_text);
3eadefdd1ff115 Li Xu          2018-10-23  3056  			cs35l41->fast_switch_enum.texts	= cs35l41_fast_switch_text;
3eadefdd1ff115 Li Xu          2018-10-23  3057  			cs35l41->fast_switch_names = cs35l41_fast_switch_text;
3eadefdd1ff115 Li Xu          2018-10-23  3058  		} else {
3eadefdd1ff115 Li Xu          2018-10-23  3059  			/* Device tree provides file name */
3eadefdd1ff115 Li Xu          2018-10-23  3060  			num_fast_switch = (size_t)ret;
afcbb92dbf5cfe Adam Brickman  2019-03-25  3061  			dev_info(dev, "num_fast_switch:%zu\n", num_fast_switch);
3eadefdd1ff115 Li Xu          2018-10-23  3062  			cs35l41->fast_switch_names =
3eadefdd1ff115 Li Xu          2018-10-23  3063  				devm_kmalloc(dev, num_fast_switch * sizeof(char *),
3eadefdd1ff115 Li Xu          2018-10-23  3064  					     GFP_KERNEL);
3eadefdd1ff115 Li Xu          2018-10-23  3065  			if (!cs35l41->fast_switch_names)
3eadefdd1ff115 Li Xu          2018-10-23  3066  				return -ENOMEM;
3eadefdd1ff115 Li Xu          2018-10-23  3067  			of_property_read_string_array(np, "cirrus,fast-switch",
3eadefdd1ff115 Li Xu          2018-10-23  3068  						      cs35l41->fast_switch_names,
3eadefdd1ff115 Li Xu          2018-10-23  3069  						      num_fast_switch);
3eadefdd1ff115 Li Xu          2018-10-23  3070  			for (i = 0; i < num_fast_switch; i++) {
3eadefdd1ff115 Li Xu          2018-10-23  3071  				dev_info(dev, "%d:%s\n", i,
3eadefdd1ff115 Li Xu          2018-10-23  3072  					 cs35l41->fast_switch_names[i]);
3eadefdd1ff115 Li Xu          2018-10-23  3073  			}
3eadefdd1ff115 Li Xu          2018-10-23  3074  			cs35l41->fast_switch_enum.items	= num_fast_switch;
3eadefdd1ff115 Li Xu          2018-10-23  3075  			cs35l41->fast_switch_enum.texts	= cs35l41->fast_switch_names;
3eadefdd1ff115 Li Xu          2018-10-23  3076  		}
e97dd8579379e5 David Rhodes   2021-08-13  3077  	} else {
e97dd8579379e5 David Rhodes   2021-08-13  3078  		cs35l41->dt_name = "cs35l41";
7383306be1da79 David Rhodes   2021-04-27  3079  	}
3eadefdd1ff115 Li Xu          2018-10-23  3080  
3eadefdd1ff115 Li Xu          2018-10-23  3081  	cs35l41->fast_switch_enum.reg = SND_SOC_NOPM;
3eadefdd1ff115 Li Xu          2018-10-23  3082  	cs35l41->fast_switch_enum.shift_l = 0;
3eadefdd1ff115 Li Xu          2018-10-23  3083  	cs35l41->fast_switch_enum.shift_r = 0;
3eadefdd1ff115 Li Xu          2018-10-23  3084  	cs35l41->fast_switch_enum.mask =
3eadefdd1ff115 Li Xu          2018-10-23 @3085  		roundup_pow_of_two(num_fast_switch) - 1;
3eadefdd1ff115 Li Xu          2018-10-23  3086  
7383306be1da79 David Rhodes   2021-04-27  3087  	pdata->right_channel = device_property_read_bool(dev,
132d6b55708631 David Rhodes   2017-06-14  3088  					"cirrus,right-channel-amp");
7383306be1da79 David Rhodes   2021-04-27  3089  	pdata->sclk_frc = device_property_read_bool(dev,
132d6b55708631 David Rhodes   2017-06-14  3090  					"cirrus,sclk-force-output");
7383306be1da79 David Rhodes   2021-04-27  3091  	pdata->lrclk_frc = device_property_read_bool(dev,
132d6b55708631 David Rhodes   2017-06-14  3092  					"cirrus,lrclk-force-output");
7383306be1da79 David Rhodes   2021-04-27  3093  	pdata->amp_gain_zc = device_property_read_bool(dev,
132d6b55708631 David Rhodes   2017-06-14  3094  					"cirrus,amp-gain-zc");
132d6b55708631 David Rhodes   2017-06-14  3095  
7383306be1da79 David Rhodes   2021-04-27  3096  	pdata->invert_pcm = device_property_read_bool(dev,
b5a81f77af783b Adam Brickman  2019-09-26  3097  					"cirrus,invert-pcm");
e0d0558b9dfd2a Li Xu          2019-10-18  3098  	pdata->shared_boost = SHARED_BOOST_DISABLED;
7383306be1da79 David Rhodes   2021-04-27  3099  	if (device_property_read_bool(dev, "cirrus,shared-boost-active"))
e0d0558b9dfd2a Li Xu          2019-10-18  3100  		pdata->shared_boost = SHARED_BOOST_ACTIVE;
7383306be1da79 David Rhodes   2021-04-27  3101  	if (device_property_read_bool(dev, "cirrus,shared-boost-passive"))
e0d0558b9dfd2a Li Xu          2019-10-18  3102  		pdata->shared_boost = SHARED_BOOST_PASSIVE;
b5a81f77af783b Adam Brickman  2019-09-26  3103  
7383306be1da79 David Rhodes   2021-04-27  3104  	pdata->fwname_use_revid = device_property_read_bool(dev,
1735f565b19ed9 David Rhodes   2019-07-09  3105  					"cirrus,fwname-use-revid");
1735f565b19ed9 David Rhodes   2019-07-09  3106  
7383306be1da79 David Rhodes   2021-04-27  3107  	if (device_property_read_u32(dev, "cirrus,temp-warn_threshold", &val) >= 0)
132d6b55708631 David Rhodes   2017-06-14  3108  		pdata->temp_warn_thld = val | CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3109  
7383306be1da79 David Rhodes   2021-04-27  3110  	ret = device_property_read_u32(dev, "cirrus,boost-ctl-millivolt", &val);
132d6b55708631 David Rhodes   2017-06-14  3111  	if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3112  		if (val < 2550 || val > 11000) {
132d6b55708631 David Rhodes   2017-06-14  3113  			dev_err(dev,
132d6b55708631 David Rhodes   2017-06-14  3114  				"Invalid Boost Voltage %u mV\n", val);
132d6b55708631 David Rhodes   2017-06-14  3115  			return -EINVAL;
132d6b55708631 David Rhodes   2017-06-14  3116  		}
132d6b55708631 David Rhodes   2017-06-14  3117  		pdata->bst_vctrl = ((val - 2550) / 100) + 1;
132d6b55708631 David Rhodes   2017-06-14  3118  	}
132d6b55708631 David Rhodes   2017-06-14  3119  
7383306be1da79 David Rhodes   2021-04-27  3120  	ret = device_property_read_u32(dev, "cirrus,boost-peak-milliamp", &val);
b8be2c05bcfe3d David Rhodes   2018-01-08  3121  	if (ret >= 0)
b8be2c05bcfe3d David Rhodes   2018-01-08  3122  		pdata->bst_ipk = val;
b8be2c05bcfe3d David Rhodes   2018-01-08  3123  
7383306be1da79 David Rhodes   2021-04-27  3124  	ret = device_property_read_u32(dev, "cirrus,boost-ind-nanohenry", &val);
b8be2c05bcfe3d David Rhodes   2018-01-08  3125  	if (ret >= 0)
b8be2c05bcfe3d David Rhodes   2018-01-08  3126  		pdata->bst_ind = val;
b8be2c05bcfe3d David Rhodes   2018-01-08  3127  
7383306be1da79 David Rhodes   2021-04-27  3128  	ret = device_property_read_u32(dev, "cirrus,boost-cap-microfarad", &val);
b8be2c05bcfe3d David Rhodes   2018-01-08  3129  	if (ret >= 0)
b8be2c05bcfe3d David Rhodes   2018-01-08  3130  		pdata->bst_cap = val;
132d6b55708631 David Rhodes   2017-06-14  3131  
7383306be1da79 David Rhodes   2021-04-27  3132  	ret = device_property_read_u32(dev, "cirrus,asp-sdout-hiz", &val);
d06af090fc0b00 James Schulman 2018-02-23  3133  	if (ret >= 0)
d06af090fc0b00 James Schulman 2018-02-23  3134  		pdata->dout_hiz = val;
d06af090fc0b00 James Schulman 2018-02-23  3135  	else
d06af090fc0b00 James Schulman 2018-02-23  3136  		pdata->dout_hiz = -1;
d06af090fc0b00 James Schulman 2018-02-23  3137  
7383306be1da79 David Rhodes   2021-04-27  3138  	pdata->dsp_ng_enable = device_property_read_bool(dev,
d49ae28577d739 David Rhodes   2019-07-26  3139  					"cirrus,dsp-noise-gate-enable");
7383306be1da79 David Rhodes   2021-04-27  3140  	if (device_property_read_u32(dev,
d49ae28577d739 David Rhodes   2019-07-26  3141  				"cirrus,dsp-noise-gate-threshold", &val) >= 0)
d49ae28577d739 David Rhodes   2019-07-26  3142  		pdata->dsp_ng_pcm_thld = val | CS35L41_VALID_PDATA;
7383306be1da79 David Rhodes   2021-04-27  3143  	if (device_property_read_u32(dev, "cirrus,dsp-noise-gate-delay", &val) >= 0)
d49ae28577d739 David Rhodes   2019-07-26  3144  		pdata->dsp_ng_delay = val | CS35L41_VALID_PDATA;
d49ae28577d739 David Rhodes   2019-07-26  3145  
7383306be1da79 David Rhodes   2021-04-27  3146  	if (device_property_read_u32(dev, "cirrus,hw-noise-gate-select", &val) >= 0)
d49ae28577d739 David Rhodes   2019-07-26  3147  		pdata->hw_ng_sel = val | CS35L41_VALID_PDATA;
7383306be1da79 David Rhodes   2021-04-27  3148  	if (device_property_read_u32(dev,
d49ae28577d739 David Rhodes   2019-07-26  3149  				"cirrus,hw-noise-gate-threshold", &val) >= 0)
d49ae28577d739 David Rhodes   2019-07-26  3150  		pdata->hw_ng_thld = val | CS35L41_VALID_PDATA;
7383306be1da79 David Rhodes   2021-04-27  3151  	if (device_property_read_u32(dev, "cirrus,hw-noise-gate-delay", &val) >= 0)
d49ae28577d739 David Rhodes   2019-07-26  3152  		pdata->hw_ng_delay = val | CS35L41_VALID_PDATA;
cca40d9e37a276 David Rhodes   2017-11-13  3153  
7383306be1da79 David Rhodes   2021-04-27  3154  	classh_config->classh_algo_enable =
7383306be1da79 David Rhodes   2021-04-27  3155  				device_property_read_bool(dev, "cirrus,classh-internal-algo");
132d6b55708631 David Rhodes   2017-06-14  3156  
132d6b55708631 David Rhodes   2017-06-14  3157  	if (classh_config->classh_algo_enable) {
132d6b55708631 David Rhodes   2017-06-14  3158  		classh_config->classh_bst_override =
7383306be1da79 David Rhodes   2021-04-27  3159  			device_property_read_bool(dev,
775a943befe860 David Rhodes   2020-07-14  3160  				"cirrus,classh-bst-override");
132d6b55708631 David Rhodes   2017-06-14  3161  
7383306be1da79 David Rhodes   2021-04-27  3162  		ret = device_property_read_u32(dev,
132d6b55708631 David Rhodes   2017-06-14  3163  					   "cirrus,classh-bst-max-limit",
132d6b55708631 David Rhodes   2017-06-14  3164  					   &val);
132d6b55708631 David Rhodes   2017-06-14  3165  		if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3166  			val |= CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3167  			classh_config->classh_bst_max_limit = val;
132d6b55708631 David Rhodes   2017-06-14  3168  		}
132d6b55708631 David Rhodes   2017-06-14  3169  
7383306be1da79 David Rhodes   2021-04-27  3170  		ret = device_property_read_u32(dev, "cirrus,classh-mem-depth",
132d6b55708631 David Rhodes   2017-06-14  3171  					   &val);
132d6b55708631 David Rhodes   2017-06-14  3172  		if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3173  			val |= CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3174  			classh_config->classh_mem_depth = val;
132d6b55708631 David Rhodes   2017-06-14  3175  		}
132d6b55708631 David Rhodes   2017-06-14  3176  
7383306be1da79 David Rhodes   2021-04-27  3177  		ret = device_property_read_u32(dev,
b04679e39117f7 David Rhodes   2017-10-31  3178  					"cirrus,classh-release-rate", &val);
132d6b55708631 David Rhodes   2017-06-14  3179  		if (ret >= 0)
132d6b55708631 David Rhodes   2017-06-14  3180  			classh_config->classh_release_rate = val;
132d6b55708631 David Rhodes   2017-06-14  3181  
7383306be1da79 David Rhodes   2021-04-27  3182  		ret = device_property_read_u32(dev, "cirrus,classh-headroom",
132d6b55708631 David Rhodes   2017-06-14  3183  					   &val);
132d6b55708631 David Rhodes   2017-06-14  3184  		if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3185  			val |= CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3186  			classh_config->classh_headroom = val;
132d6b55708631 David Rhodes   2017-06-14  3187  		}
132d6b55708631 David Rhodes   2017-06-14  3188  
7383306be1da79 David Rhodes   2021-04-27  3189  		ret = device_property_read_u32(dev,
b04679e39117f7 David Rhodes   2017-10-31  3190  					"cirrus,classh-wk-fet-delay", &val);
132d6b55708631 David Rhodes   2017-06-14  3191  		if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3192  			val |= CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3193  			classh_config->classh_wk_fet_delay = val;
132d6b55708631 David Rhodes   2017-06-14  3194  		}
132d6b55708631 David Rhodes   2017-06-14  3195  
7383306be1da79 David Rhodes   2021-04-27  3196  		ret = device_property_read_u32(dev,
b04679e39117f7 David Rhodes   2017-10-31  3197  					"cirrus,classh-wk-fet-thld", &val);
132d6b55708631 David Rhodes   2017-06-14  3198  		if (ret >= 0)
132d6b55708631 David Rhodes   2017-06-14  3199  			classh_config->classh_wk_fet_thld = val;
132d6b55708631 David Rhodes   2017-06-14  3200  	}
132d6b55708631 David Rhodes   2017-06-14  3201  
132d6b55708631 David Rhodes   2017-06-14  3202  	/* GPIO1 Pin Config */
7383306be1da79 David Rhodes   2021-04-27  3203  	irq_gpio1_config->irq_pol_inv = device_property_read_bool(dev,
7383306be1da79 David Rhodes   2021-04-27  3204  					"cirrus,gpio1-polarity-invert");
7383306be1da79 David Rhodes   2021-04-27  3205  	irq_gpio1_config->irq_out_en = device_property_read_bool(dev,
7383306be1da79 David Rhodes   2021-04-27  3206  					"cirrus,gpio1-output-enable");
7383306be1da79 David Rhodes   2021-04-27  3207  	ret = device_property_read_u32(dev, "cirrus,gpio1-src-select",
132d6b55708631 David Rhodes   2017-06-14  3208  				&val);
132d6b55708631 David Rhodes   2017-06-14  3209  	if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3210  		val |= CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3211  		irq_gpio1_config->irq_src_sel = val;
132d6b55708631 David Rhodes   2017-06-14  3212  	}
132d6b55708631 David Rhodes   2017-06-14  3213  
132d6b55708631 David Rhodes   2017-06-14  3214  	/* GPIO2 Pin Config */
7383306be1da79 David Rhodes   2021-04-27  3215  	irq_gpio2_config->irq_pol_inv = device_property_read_bool(dev,
7383306be1da79 David Rhodes   2021-04-27  3216  					"cirrus,gpio2-polarity-invert");
7383306be1da79 David Rhodes   2021-04-27  3217  	irq_gpio2_config->irq_out_en = device_property_read_bool(dev,
7383306be1da79 David Rhodes   2021-04-27  3218  					"cirrus,gpio2-output-enable");
7383306be1da79 David Rhodes   2021-04-27  3219  	ret = device_property_read_u32(dev, "cirrus,gpio2-src-select",
132d6b55708631 David Rhodes   2017-06-14  3220  				&val);
132d6b55708631 David Rhodes   2017-06-14  3221  	if (ret >= 0) {
132d6b55708631 David Rhodes   2017-06-14  3222  		val |= CS35L41_VALID_PDATA;
132d6b55708631 David Rhodes   2017-06-14  3223  		irq_gpio2_config->irq_src_sel = val;
132d6b55708631 David Rhodes   2017-06-14  3224  	}
132d6b55708631 David Rhodes   2017-06-14  3225  
7383306be1da79 David Rhodes   2021-04-27  3226  	pdata->hibernate_enable = device_property_read_bool(dev,
913533a268171c David Rhodes   2019-07-03  3227  					"cirrus,hibernate-enable");
913533a268171c David Rhodes   2019-07-03  3228  
132d6b55708631 David Rhodes   2017-06-14  3229  	return 0;
132d6b55708631 David Rhodes   2017-06-14  3230  }
132d6b55708631 David Rhodes   2017-06-14  3231  

:::::: The code at line 3085 was first introduced by commit
:::::: 3eadefdd1ff115f54dd9118a2bf6ebaa45574b37 ASoC: cs35l41: Add fast use case switch feature

:::::: TO: Li Xu <li.xu@cirrus.com>
:::::: CC: Vijendar Mukunda <Vijendar.Mukunda@amd.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29532 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-30 20:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 20:32 [agd5f:audio-for-next 138/153] sound/soc/codecs/cs35l41.c:3085 cs35l41_handle_pdata() error: uninitialized symbol 'num_fast_switch' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.