[kbuild] [xlnx:release-2020.2.2_k26 207/241] drivers/pinctrl/core.c:1273 pinctrl_commit_state() error: uninitialized symbol 'ret'.

Dan Carpenter dan.carpenter at oracle.com
Tue Apr 20 10:23:25 BST 2021


tree:   https://github.com/Xilinx/linux-xlnx  release-2020.2.2_k26
head:   4731ff5042ce76fc145bc2797faa2d91b090675e
commit: 11367d8e6e31164b198401335b9a19b5b7234ec0 [207/241] pinctrl: core: Handling pinmux and pinconf separately
config: i386-randconfig-m021-20210419 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

New smatch warnings:
drivers/pinctrl/core.c:1273 pinctrl_commit_state() error: uninitialized symbol 'ret'.

vim +/ret +1273 drivers/pinctrl/core.c

981ed1bfbc6c46 Florian Fainelli  2017-03-01  1237  static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state)
befe5bdfbb698b Linus Walleij     2012-02-09  1238  {
6e5e959dde0d92 Stephen Warren    2012-03-02  1239  	struct pinctrl_setting *setting, *setting2;
50cf7c8ab324de Richard Genoud    2013-03-25  1240  	struct pinctrl_state *old_state = p->state;
6e5e959dde0d92 Stephen Warren    2012-03-02  1241  	int ret;
7ecdb16fe63e5b Stephen Warren    2012-03-02  1242  
6e5e959dde0d92 Stephen Warren    2012-03-02  1243  	if (p->state) {
6e5e959dde0d92 Stephen Warren    2012-03-02  1244  		/*
2243a87d90b42e Fan Wu            2014-06-09  1245  		 * For each pinmux setting in the old state, forget SW's record
2243a87d90b42e Fan Wu            2014-06-09  1246  		 * of mux owner for that pingroup. Any pingroups which are
2243a87d90b42e Fan Wu            2014-06-09  1247  		 * still owned by the new state will be re-acquired by the call
2243a87d90b42e Fan Wu            2014-06-09  1248  		 * to pinmux_enable_setting() in the loop below.
6e5e959dde0d92 Stephen Warren    2012-03-02  1249  		 */
6e5e959dde0d92 Stephen Warren    2012-03-02  1250  		list_for_each_entry(setting, &p->state->settings, node) {
1e2082b5207217 Stephen Warren    2012-03-02  1251  			if (setting->type != PIN_MAP_TYPE_MUX_GROUP)
1e2082b5207217 Stephen Warren    2012-03-02  1252  				continue;
7ecdb16fe63e5b Stephen Warren    2012-03-02  1253  			pinmux_disable_setting(setting);
befe5bdfbb698b Linus Walleij     2012-02-09  1254  		}
57b676f9c1b7cd Stephen Warren    2012-03-02  1255  	}
57b676f9c1b7cd Stephen Warren    2012-03-02  1256  
3102a76cfbf9ac Richard Genoud    2013-03-25  1257  	p->state = NULL;
6e5e959dde0d92 Stephen Warren    2012-03-02  1258  
11367d8e6e3116 Michal Simek      2021-03-10  1259  	/* Apply all the settings for the new state - pinmux first */
6e5e959dde0d92 Stephen Warren    2012-03-02  1260  	list_for_each_entry(setting, &state->settings, node) {
1e2082b5207217 Stephen Warren    2012-03-02  1261  		switch (setting->type) {
1e2082b5207217 Stephen Warren    2012-03-02  1262  		case PIN_MAP_TYPE_MUX_GROUP:
6e5e959dde0d92 Stephen Warren    2012-03-02  1263  			ret = pinmux_enable_setting(setting);
1e2082b5207217 Stephen Warren    2012-03-02  1264  			break;
1e2082b5207217 Stephen Warren    2012-03-02  1265  		case PIN_MAP_TYPE_CONFIGS_PIN:
11367d8e6e3116 Michal Simek      2021-03-10  1266  		case PIN_MAP_TYPE_CONFIGS_GROUP:
11367d8e6e3116 Michal Simek      2021-03-10  1267  			break;

"ret" not set for these cases.

11367d8e6e3116 Michal Simek      2021-03-10  1268  		default:
11367d8e6e3116 Michal Simek      2021-03-10  1269  			ret = -EINVAL;
11367d8e6e3116 Michal Simek      2021-03-10  1270  			break;
11367d8e6e3116 Michal Simek      2021-03-10  1271  		}
11367d8e6e3116 Michal Simek      2021-03-10  1272  
11367d8e6e3116 Michal Simek      2021-03-10 @1273  		if (ret < 0)
11367d8e6e3116 Michal Simek      2021-03-10  1274  			goto unapply_new_state;
11367d8e6e3116 Michal Simek      2021-03-10  1275  
11367d8e6e3116 Michal Simek      2021-03-10  1276  		/* Do not link hogs (circular dependency) */
11367d8e6e3116 Michal Simek      2021-03-10  1277  		if (p != setting->pctldev->p)
11367d8e6e3116 Michal Simek      2021-03-10  1278  			pinctrl_link_add(setting->pctldev, p->dev);
11367d8e6e3116 Michal Simek      2021-03-10  1279  	}
11367d8e6e3116 Michal Simek      2021-03-10  1280  
11367d8e6e3116 Michal Simek      2021-03-10  1281  	/* Apply all the settings for the new state - pinconf after */
11367d8e6e3116 Michal Simek      2021-03-10  1282  	list_for_each_entry(setting, &state->settings, node) {
11367d8e6e3116 Michal Simek      2021-03-10  1283  		switch (setting->type) {
11367d8e6e3116 Michal Simek      2021-03-10  1284  		case PIN_MAP_TYPE_MUX_GROUP:
11367d8e6e3116 Michal Simek      2021-03-10  1285  			break;

Same.  We probably just want to initialize it in the declaration.

11367d8e6e3116 Michal Simek      2021-03-10  1286  		case PIN_MAP_TYPE_CONFIGS_PIN:
1e2082b5207217 Stephen Warren    2012-03-02  1287  		case PIN_MAP_TYPE_CONFIGS_GROUP:
1e2082b5207217 Stephen Warren    2012-03-02  1288  			ret = pinconf_apply_setting(setting);
1e2082b5207217 Stephen Warren    2012-03-02  1289  			break;
1e2082b5207217 Stephen Warren    2012-03-02  1290  		default:
1e2082b5207217 Stephen Warren    2012-03-02  1291  			ret = -EINVAL;
1e2082b5207217 Stephen Warren    2012-03-02  1292  			break;
1e2082b5207217 Stephen Warren    2012-03-02  1293  		}
3102a76cfbf9ac Richard Genoud    2013-03-25  1294  
42fed7ba44e4e8 Patrice Chotard   2013-04-11  1295  		if (ret < 0) {
3102a76cfbf9ac Richard Genoud    2013-03-25  1296  			goto unapply_new_state;
6e5e959dde0d92 Stephen Warren    2012-03-02  1297  		}
036f394dd77f81 Benjamin Gaignard 2019-05-22  1298  
b672a87ae5ab07 Linus Walleij     2019-05-24  1299  		/* Do not link hogs (circular dependency) */
b672a87ae5ab07 Linus Walleij     2019-05-24  1300  		if (p != setting->pctldev->p)
036f394dd77f81 Benjamin Gaignard 2019-05-22  1301  			pinctrl_link_add(setting->pctldev, p->dev);
42fed7ba44e4e8 Patrice Chotard   2013-04-11  1302  	}
6e5e959dde0d92 Stephen Warren    2012-03-02  1303  
3102a76cfbf9ac Richard Genoud    2013-03-25  1304  	p->state = state;
3102a76cfbf9ac Richard Genoud    2013-03-25  1305  
6e5e959dde0d92 Stephen Warren    2012-03-02  1306  	return 0;
3102a76cfbf9ac Richard Genoud    2013-03-25  1307  
3102a76cfbf9ac Richard Genoud    2013-03-25  1308  unapply_new_state:
da58751ca2490d Richard Genoud    2013-03-28  1309  	dev_err(p->dev, "Error applying setting, reverse things back\n");
3102a76cfbf9ac Richard Genoud    2013-03-25  1310  
3102a76cfbf9ac Richard Genoud    2013-03-25  1311  	list_for_each_entry(setting2, &state->settings, node) {
3102a76cfbf9ac Richard Genoud    2013-03-25  1312  		if (&setting2->node == &setting->node)
3102a76cfbf9ac Richard Genoud    2013-03-25  1313  			break;
af606177713163 Richard Genoud    2013-03-29  1314  		/*
af606177713163 Richard Genoud    2013-03-29  1315  		 * All we can do here is pinmux_disable_setting.
af606177713163 Richard Genoud    2013-03-29  1316  		 * That means that some pins are muxed differently now
af606177713163 Richard Genoud    2013-03-29  1317  		 * than they were before applying the setting (We can't
af606177713163 Richard Genoud    2013-03-29  1318  		 * "unmux a pin"!), but it's not a big deal since the pins
af606177713163 Richard Genoud    2013-03-29  1319  		 * are free to be muxed by another apply_setting.
af606177713163 Richard Genoud    2013-03-29  1320  		 */
af606177713163 Richard Genoud    2013-03-29  1321  		if (setting2->type == PIN_MAP_TYPE_MUX_GROUP)
af606177713163 Richard Genoud    2013-03-29  1322  			pinmux_disable_setting(setting2);
3102a76cfbf9ac Richard Genoud    2013-03-25  1323  	}
8009d5ff00df6a Richard Genoud    2013-03-28  1324  
385d94246b05f7 Richard Genoud    2013-03-29  1325  	/* There's no infinite recursive loop here because p->state is NULL */
385d94246b05f7 Richard Genoud    2013-03-29  1326  	if (old_state)
42fed7ba44e4e8 Patrice Chotard   2013-04-11  1327  		pinctrl_select_state(p, old_state);
6e5e959dde0d92 Stephen Warren    2012-03-02  1328  
6e5e959dde0d92 Stephen Warren    2012-03-02  1329  	return ret;
befe5bdfbb698b Linus Walleij     2012-02-09  1330  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 29171 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210420/ad278d5b/attachment-0001.gz>
-------------- next part --------------
_______________________________________________
kbuild mailing list -- kbuild at lists.01.org
To unsubscribe send an email to kbuild-leave at lists.01.org


More information about the linux-arm-kernel mailing list