Re: [PATCH 2/3] megaraid_sas: Rework device add code in AEN path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shivasharan,

I love your patch! Perhaps something to improve:

url:    https://github.com/0day-ci/linux/commits/Shivasharan-S/megaraid_sas-Rework-code-to-get-PD-and-LD-list/20190121-132655

New smatch warnings:
drivers/scsi/megaraid/megaraid_sas_base.c:7919 megasas_update_device_list() error: uninitialized symbol 'dcmd_ret'.

Old smatch warnings:
drivers/scsi/megaraid/megaraid_sas_base.c:1855 megasas_set_dynamic_target_properties() warn: if statement not indented
drivers/scsi/megaraid/megaraid_sas_base.c:3319 megasas_complete_cmd() error: we previously assumed 'cmd->scmd' could be null (see line 3286)
drivers/scsi/megaraid/megaraid_sas_base.c:5613 megasas_init_fw() error: we previously assumed 'fusion' could be null (see line 5473)
drivers/scsi/megaraid/megaraid_sas_base.c:7924 megasas_update_device_list() error: uninitialized symbol 'dcmd_ret'.

# https://github.com/0day-ci/linux/commit/3ee216cd5eece3e0480372c229cac0d992460d69
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 3ee216cd5eece3e0480372c229cac0d992460d69
vim +/dcmd_ret +7919 drivers/scsi/megaraid/megaraid_sas_base.c

b4a42213a Shivasharan S 2017-02-10  7889  
3ee216cd5 Shivasharan S 2019-01-18  7890  /*
3ee216cd5 Shivasharan S 2019-01-18  7891   * megasas_update_device_list -	Update the PD and LD device list from FW
3ee216cd5 Shivasharan S 2019-01-18  7892   *				after an AEN event notification
3ee216cd5 Shivasharan S 2019-01-18  7893   * @instance:			Adapter soft state
3ee216cd5 Shivasharan S 2019-01-18  7894   * @event_type:			Indicates type of event (PD or LD event)
3ee216cd5 Shivasharan S 2019-01-18  7895   *
3ee216cd5 Shivasharan S 2019-01-18  7896   * @return:			Success or failure
3ee216cd5 Shivasharan S 2019-01-18  7897   *
3ee216cd5 Shivasharan S 2019-01-18  7898   * Issue DCMDs to Firmware to update the internal device list in driver.
3ee216cd5 Shivasharan S 2019-01-18  7899   */
3ee216cd5 Shivasharan S 2019-01-18  7900  static
3ee216cd5 Shivasharan S 2019-01-18  7901  int megasas_update_device_list(struct megasas_instance *instance,
3ee216cd5 Shivasharan S 2019-01-18  7902  			       int event_type)
3ee216cd5 Shivasharan S 2019-01-18  7903  {
3ee216cd5 Shivasharan S 2019-01-18  7904  	int dcmd_ret;
3ee216cd5 Shivasharan S 2019-01-18  7905  
3ee216cd5 Shivasharan S 2019-01-18  7906  	if (event_type & SCAN_PD_CHANNEL) {
3ee216cd5 Shivasharan S 2019-01-18  7907  		dcmd_ret = megasas_get_pd_list(instance);
3ee216cd5 Shivasharan S 2019-01-18  7908  
3ee216cd5 Shivasharan S 2019-01-18  7909  		if (dcmd_ret != DCMD_SUCCESS)
3ee216cd5 Shivasharan S 2019-01-18  7910  			goto out;
3ee216cd5 Shivasharan S 2019-01-18  7911  	}
3ee216cd5 Shivasharan S 2019-01-18  7912  
3ee216cd5 Shivasharan S 2019-01-18  7913  	if (event_type & SCAN_VD_CHANNEL) {
3ee216cd5 Shivasharan S 2019-01-18  7914  		if (!instance->requestorId ||
3ee216cd5 Shivasharan S 2019-01-18  7915  		    (instance->requestorId &&
3ee216cd5 Shivasharan S 2019-01-18  7916  		     megasas_get_ld_vf_affiliation(instance, 0)))
3ee216cd5 Shivasharan S 2019-01-18  7917  			dcmd_ret = megasas_ld_list_query(instance,
3ee216cd5 Shivasharan S 2019-01-18  7918  					MR_LD_QUERY_TYPE_EXPOSED_TO_HOST);
3ee216cd5 Shivasharan S 2019-01-18 @7919  		if (dcmd_ret != DCMD_SUCCESS)
                                                            ^^^^^^^^^^^^^^^^^^^^^^^

Not necessarily initialized.  Probably add curly braces and indent this
etc.

3ee216cd5 Shivasharan S 2019-01-18  7920  			goto out;
3ee216cd5 Shivasharan S 2019-01-18  7921  	}
3ee216cd5 Shivasharan S 2019-01-18  7922  
3ee216cd5 Shivasharan S 2019-01-18  7923  out:
3ee216cd5 Shivasharan S 2019-01-18  7924  	return dcmd_ret;
3ee216cd5 Shivasharan S 2019-01-18  7925  }
3ee216cd5 Shivasharan S 2019-01-18  7926  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux