Re: [PATCH 1/2] scsi: pm8001: Neaten debug logging macros and uses

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

 



Hi Joe,

I love your patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next next-20201123]
[cannot apply to v5.10-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Joe-Perches/scsi-pm8001-logging-neatening/20201121-072328
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-m021-20201123 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

New smatch warnings:
drivers/scsi/pm8001/pm8001_init.c:399 pm8001_alloc() warn: inconsistent indenting

Old smatch warnings:
drivers/scsi/pm8001/pm8001_init.c:472 pm8001_ioremap() warn: argument 6 to %llx specifier is cast from pointer

vim +399 drivers/scsi/pm8001/pm8001_init.c

d384be6ede5caa2 Vikram Auradkar       2020-03-16  259  
dbf9bfe615717d1 jack wang             2009-10-14  260  /**
dbf9bfe615717d1 jack wang             2009-10-14  261   * pm8001_alloc - initiate our hba structure and 6 DMAs area.
dbf9bfe615717d1 jack wang             2009-10-14  262   * @pm8001_ha: our hba structure.
e802fc43ba36be0 Lee Jones             2020-07-13  263   * @ent: PCI device ID structure to match on
dbf9bfe615717d1 jack wang             2009-10-14  264   */
e590adfd2b35aec Sakthivel K           2013-02-27  265  static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
e590adfd2b35aec Sakthivel K           2013-02-27  266  			const struct pci_device_id *ent)
dbf9bfe615717d1 jack wang             2009-10-14  267  {
05c6c029a44d9f4 Viswas G              2020-10-05  268  	int i, count = 0, rc = 0;
05c6c029a44d9f4 Viswas G              2020-10-05  269  	u32 ci_offset, ib_offset, ob_offset, pi_offset;
05c6c029a44d9f4 Viswas G              2020-10-05  270  	struct inbound_queue_table *circularQ;
05c6c029a44d9f4 Viswas G              2020-10-05  271  
dbf9bfe615717d1 jack wang             2009-10-14  272  	spin_lock_init(&pm8001_ha->lock);
646cdf0083e3d4a Tomas Henzl           2014-07-09  273  	spin_lock_init(&pm8001_ha->bitmap_lock);
3927c0782a3ac80 Joe Perches           2020-11-20  274  	pm8001_dbg(pm8001_ha, INIT, "pm8001_alloc: PHY:%x\n",
3927c0782a3ac80 Joe Perches           2020-11-20  275  		   pm8001_ha->chip->n_phy);
05c6c029a44d9f4 Viswas G              2020-10-05  276  
05c6c029a44d9f4 Viswas G              2020-10-05  277  	/* Setup Interrupt */
05c6c029a44d9f4 Viswas G              2020-10-05  278  	rc = pm8001_setup_irq(pm8001_ha);
05c6c029a44d9f4 Viswas G              2020-10-05  279  	if (rc) {
3927c0782a3ac80 Joe Perches           2020-11-20  280  		pm8001_dbg(pm8001_ha, FAIL,
3927c0782a3ac80 Joe Perches           2020-11-20  281  			   "pm8001_setup_irq failed [ret: %d]\n", rc);
05c6c029a44d9f4 Viswas G              2020-10-05  282  		goto err_out_shost;
05c6c029a44d9f4 Viswas G              2020-10-05  283  	}
05c6c029a44d9f4 Viswas G              2020-10-05  284  	/* Request Interrupt */
05c6c029a44d9f4 Viswas G              2020-10-05  285  	rc = pm8001_request_irq(pm8001_ha);
05c6c029a44d9f4 Viswas G              2020-10-05  286  	if (rc)
05c6c029a44d9f4 Viswas G              2020-10-05  287  		goto err_out_shost;
05c6c029a44d9f4 Viswas G              2020-10-05  288  
05c6c029a44d9f4 Viswas G              2020-10-05  289  	count = pm8001_ha->max_q_num;
05c6c029a44d9f4 Viswas G              2020-10-05  290  	/* Queues are chosen based on the number of cores/msix availability */
27bc43bd7c42b39 Viswas G              2020-10-05  291  	ib_offset = pm8001_ha->ib_offset  = USI_MAX_MEMCNT_BASE;
05c6c029a44d9f4 Viswas G              2020-10-05  292  	ci_offset = pm8001_ha->ci_offset  = ib_offset + count;
05c6c029a44d9f4 Viswas G              2020-10-05  293  	ob_offset = pm8001_ha->ob_offset  = ci_offset + count;
05c6c029a44d9f4 Viswas G              2020-10-05  294  	pi_offset = pm8001_ha->pi_offset  = ob_offset + count;
05c6c029a44d9f4 Viswas G              2020-10-05  295  	pm8001_ha->max_memcnt = pi_offset + count;
05c6c029a44d9f4 Viswas G              2020-10-05  296  
1cc943ae5003e46 jack wang             2009-12-07  297  	for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
dbf9bfe615717d1 jack wang             2009-10-14  298  		pm8001_phy_init(pm8001_ha, i);
1cc943ae5003e46 jack wang             2009-12-07  299  		pm8001_ha->port[i].wide_port_phymap = 0;
1cc943ae5003e46 jack wang             2009-12-07  300  		pm8001_ha->port[i].port_attached = 0;
1cc943ae5003e46 jack wang             2009-12-07  301  		pm8001_ha->port[i].port_state = 0;
1cc943ae5003e46 jack wang             2009-12-07  302  		INIT_LIST_HEAD(&pm8001_ha->port[i].list);
1cc943ae5003e46 jack wang             2009-12-07  303  	}
dbf9bfe615717d1 jack wang             2009-10-14  304  
dbf9bfe615717d1 jack wang             2009-10-14  305  	/* MPI Memory region 1 for AAP Event Log for fw */
dbf9bfe615717d1 jack wang             2009-10-14  306  	pm8001_ha->memoryMap.region[AAP1].num_elements = 1;
dbf9bfe615717d1 jack wang             2009-10-14  307  	pm8001_ha->memoryMap.region[AAP1].element_size = PM8001_EVENT_LOG_SIZE;
dbf9bfe615717d1 jack wang             2009-10-14  308  	pm8001_ha->memoryMap.region[AAP1].total_len = PM8001_EVENT_LOG_SIZE;
dbf9bfe615717d1 jack wang             2009-10-14  309  	pm8001_ha->memoryMap.region[AAP1].alignment = 32;
dbf9bfe615717d1 jack wang             2009-10-14  310  
dbf9bfe615717d1 jack wang             2009-10-14  311  	/* MPI Memory region 2 for IOP Event Log for fw */
dbf9bfe615717d1 jack wang             2009-10-14  312  	pm8001_ha->memoryMap.region[IOP].num_elements = 1;
dbf9bfe615717d1 jack wang             2009-10-14  313  	pm8001_ha->memoryMap.region[IOP].element_size = PM8001_EVENT_LOG_SIZE;
dbf9bfe615717d1 jack wang             2009-10-14  314  	pm8001_ha->memoryMap.region[IOP].total_len = PM8001_EVENT_LOG_SIZE;
dbf9bfe615717d1 jack wang             2009-10-14  315  	pm8001_ha->memoryMap.region[IOP].alignment = 32;
dbf9bfe615717d1 jack wang             2009-10-14  316  
05c6c029a44d9f4 Viswas G              2020-10-05  317  	for (i = 0; i < count; i++) {
05c6c029a44d9f4 Viswas G              2020-10-05  318  		circularQ = &pm8001_ha->inbnd_q_tbl[i];
05c6c029a44d9f4 Viswas G              2020-10-05  319  		spin_lock_init(&circularQ->iq_lock);
dbf9bfe615717d1 jack wang             2009-10-14  320  		/* MPI Memory region 3 for consumer Index of inbound queues */
05c6c029a44d9f4 Viswas G              2020-10-05  321  		pm8001_ha->memoryMap.region[ci_offset+i].num_elements = 1;
05c6c029a44d9f4 Viswas G              2020-10-05  322  		pm8001_ha->memoryMap.region[ci_offset+i].element_size = 4;
05c6c029a44d9f4 Viswas G              2020-10-05  323  		pm8001_ha->memoryMap.region[ci_offset+i].total_len = 4;
05c6c029a44d9f4 Viswas G              2020-10-05  324  		pm8001_ha->memoryMap.region[ci_offset+i].alignment = 4;
dbf9bfe615717d1 jack wang             2009-10-14  325  
e590adfd2b35aec Sakthivel K           2013-02-27  326  		if ((ent->driver_data) != chip_8001) {
dbf9bfe615717d1 jack wang             2009-10-14  327  			/* MPI Memory region 5 inbound queues */
05c6c029a44d9f4 Viswas G              2020-10-05  328  			pm8001_ha->memoryMap.region[ib_offset+i].num_elements =
e590adfd2b35aec Sakthivel K           2013-02-27  329  						PM8001_MPI_QUEUE;
05c6c029a44d9f4 Viswas G              2020-10-05  330  			pm8001_ha->memoryMap.region[ib_offset+i].element_size
05c6c029a44d9f4 Viswas G              2020-10-05  331  								= 128;
05c6c029a44d9f4 Viswas G              2020-10-05  332  			pm8001_ha->memoryMap.region[ib_offset+i].total_len =
e590adfd2b35aec Sakthivel K           2013-02-27  333  						PM8001_MPI_QUEUE * 128;
05c6c029a44d9f4 Viswas G              2020-10-05  334  			pm8001_ha->memoryMap.region[ib_offset+i].alignment
05c6c029a44d9f4 Viswas G              2020-10-05  335  								= 128;
e590adfd2b35aec Sakthivel K           2013-02-27  336  		} else {
05c6c029a44d9f4 Viswas G              2020-10-05  337  			pm8001_ha->memoryMap.region[ib_offset+i].num_elements =
e590adfd2b35aec Sakthivel K           2013-02-27  338  						PM8001_MPI_QUEUE;
05c6c029a44d9f4 Viswas G              2020-10-05  339  			pm8001_ha->memoryMap.region[ib_offset+i].element_size
05c6c029a44d9f4 Viswas G              2020-10-05  340  								= 64;
05c6c029a44d9f4 Viswas G              2020-10-05  341  			pm8001_ha->memoryMap.region[ib_offset+i].total_len =
e590adfd2b35aec Sakthivel K           2013-02-27  342  						PM8001_MPI_QUEUE * 64;
05c6c029a44d9f4 Viswas G              2020-10-05  343  			pm8001_ha->memoryMap.region[ib_offset+i].alignment = 64;
e590adfd2b35aec Sakthivel K           2013-02-27  344  		}
e590adfd2b35aec Sakthivel K           2013-02-27  345  	}
dbf9bfe615717d1 jack wang             2009-10-14  346  
05c6c029a44d9f4 Viswas G              2020-10-05  347  	for (i = 0; i < count; i++) {
e590adfd2b35aec Sakthivel K           2013-02-27  348  		/* MPI Memory region 4 for producer Index of outbound queues */
05c6c029a44d9f4 Viswas G              2020-10-05  349  		pm8001_ha->memoryMap.region[pi_offset+i].num_elements = 1;
05c6c029a44d9f4 Viswas G              2020-10-05  350  		pm8001_ha->memoryMap.region[pi_offset+i].element_size = 4;
05c6c029a44d9f4 Viswas G              2020-10-05  351  		pm8001_ha->memoryMap.region[pi_offset+i].total_len = 4;
05c6c029a44d9f4 Viswas G              2020-10-05  352  		pm8001_ha->memoryMap.region[pi_offset+i].alignment = 4;
e590adfd2b35aec Sakthivel K           2013-02-27  353  
e590adfd2b35aec Sakthivel K           2013-02-27  354  		if (ent->driver_data != chip_8001) {
e590adfd2b35aec Sakthivel K           2013-02-27  355  			/* MPI Memory region 6 Outbound queues */
05c6c029a44d9f4 Viswas G              2020-10-05  356  			pm8001_ha->memoryMap.region[ob_offset+i].num_elements =
e590adfd2b35aec Sakthivel K           2013-02-27  357  						PM8001_MPI_QUEUE;
05c6c029a44d9f4 Viswas G              2020-10-05  358  			pm8001_ha->memoryMap.region[ob_offset+i].element_size
05c6c029a44d9f4 Viswas G              2020-10-05  359  								= 128;
05c6c029a44d9f4 Viswas G              2020-10-05  360  			pm8001_ha->memoryMap.region[ob_offset+i].total_len =
e590adfd2b35aec Sakthivel K           2013-02-27  361  						PM8001_MPI_QUEUE * 128;
05c6c029a44d9f4 Viswas G              2020-10-05  362  			pm8001_ha->memoryMap.region[ob_offset+i].alignment
05c6c029a44d9f4 Viswas G              2020-10-05  363  								= 128;
e590adfd2b35aec Sakthivel K           2013-02-27  364  		} else {
e590adfd2b35aec Sakthivel K           2013-02-27  365  			/* MPI Memory region 6 Outbound queues */
05c6c029a44d9f4 Viswas G              2020-10-05  366  			pm8001_ha->memoryMap.region[ob_offset+i].num_elements =
e590adfd2b35aec Sakthivel K           2013-02-27  367  						PM8001_MPI_QUEUE;
05c6c029a44d9f4 Viswas G              2020-10-05  368  			pm8001_ha->memoryMap.region[ob_offset+i].element_size
05c6c029a44d9f4 Viswas G              2020-10-05  369  								= 64;
05c6c029a44d9f4 Viswas G              2020-10-05  370  			pm8001_ha->memoryMap.region[ob_offset+i].total_len =
e590adfd2b35aec Sakthivel K           2013-02-27  371  						PM8001_MPI_QUEUE * 64;
05c6c029a44d9f4 Viswas G              2020-10-05  372  			pm8001_ha->memoryMap.region[ob_offset+i].alignment = 64;
e590adfd2b35aec Sakthivel K           2013-02-27  373  		}
dbf9bfe615717d1 jack wang             2009-10-14  374  
e590adfd2b35aec Sakthivel K           2013-02-27  375  	}
dbf9bfe615717d1 jack wang             2009-10-14  376  	/* Memory region write DMA*/
dbf9bfe615717d1 jack wang             2009-10-14  377  	pm8001_ha->memoryMap.region[NVMD].num_elements = 1;
dbf9bfe615717d1 jack wang             2009-10-14  378  	pm8001_ha->memoryMap.region[NVMD].element_size = 4096;
dbf9bfe615717d1 jack wang             2009-10-14  379  	pm8001_ha->memoryMap.region[NVMD].total_len = 4096;
dbf9bfe615717d1 jack wang             2009-10-14  380  
1c75a6796ea8b16 Sakthivel K           2013-03-19  381  	/* Memory region for fw flash */
1c75a6796ea8b16 Sakthivel K           2013-03-19  382  	pm8001_ha->memoryMap.region[FW_FLASH].total_len = 4096;
1c75a6796ea8b16 Sakthivel K           2013-03-19  383  
d078b5117f18dce Anand Kumar Santhanam 2013-09-04  384  	pm8001_ha->memoryMap.region[FORENSIC_MEM].num_elements = 1;
d078b5117f18dce Anand Kumar Santhanam 2013-09-04  385  	pm8001_ha->memoryMap.region[FORENSIC_MEM].total_len = 0x10000;
d078b5117f18dce Anand Kumar Santhanam 2013-09-04  386  	pm8001_ha->memoryMap.region[FORENSIC_MEM].element_size = 0x10000;
d078b5117f18dce Anand Kumar Santhanam 2013-09-04  387  	pm8001_ha->memoryMap.region[FORENSIC_MEM].alignment = 0x10000;
05c6c029a44d9f4 Viswas G              2020-10-05  388  	for (i = 0; i < pm8001_ha->max_memcnt; i++) {
dbf9bfe615717d1 jack wang             2009-10-14  389  		if (pm8001_mem_alloc(pm8001_ha->pdev,
dbf9bfe615717d1 jack wang             2009-10-14  390  			&pm8001_ha->memoryMap.region[i].virt_ptr,
dbf9bfe615717d1 jack wang             2009-10-14  391  			&pm8001_ha->memoryMap.region[i].phys_addr,
dbf9bfe615717d1 jack wang             2009-10-14  392  			&pm8001_ha->memoryMap.region[i].phys_addr_hi,
dbf9bfe615717d1 jack wang             2009-10-14  393  			&pm8001_ha->memoryMap.region[i].phys_addr_lo,
dbf9bfe615717d1 jack wang             2009-10-14  394  			pm8001_ha->memoryMap.region[i].total_len,
dbf9bfe615717d1 jack wang             2009-10-14  395  			pm8001_ha->memoryMap.region[i].alignment) != 0) {
3927c0782a3ac80 Joe Perches           2020-11-20  396  			pm8001_dbg(pm8001_ha, FAIL,
3927c0782a3ac80 Joe Perches           2020-11-20  397  				   "Mem%d alloc failed\n",
3927c0782a3ac80 Joe Perches           2020-11-20  398  				   i);
dbf9bfe615717d1 jack wang             2009-10-14 @399  				goto err_out;
dbf9bfe615717d1 jack wang             2009-10-14  400  		}
dbf9bfe615717d1 jack wang             2009-10-14  401  	}
dbf9bfe615717d1 jack wang             2009-10-14  402  
27bc43bd7c42b39 Viswas G              2020-10-05  403  	/* Memory region for devices*/
27bc43bd7c42b39 Viswas G              2020-10-05  404  	pm8001_ha->devices = kzalloc(PM8001_MAX_DEVICES
27bc43bd7c42b39 Viswas G              2020-10-05  405  				* sizeof(struct pm8001_device), GFP_KERNEL);
27bc43bd7c42b39 Viswas G              2020-10-05  406  	if (!pm8001_ha->devices) {
27bc43bd7c42b39 Viswas G              2020-10-05  407  		rc = -ENOMEM;
27bc43bd7c42b39 Viswas G              2020-10-05  408  		goto err_out_nodev;
27bc43bd7c42b39 Viswas G              2020-10-05  409  	}
dbf9bfe615717d1 jack wang             2009-10-14  410  	for (i = 0; i < PM8001_MAX_DEVICES; i++) {
aa9f8328fc51460 James Bottomley       2013-05-07  411  		pm8001_ha->devices[i].dev_type = SAS_PHY_UNUSED;
dbf9bfe615717d1 jack wang             2009-10-14  412  		pm8001_ha->devices[i].id = i;
dbf9bfe615717d1 jack wang             2009-10-14  413  		pm8001_ha->devices[i].device_id = PM8001_MAX_DEVICES;
4a2efd4b89fcaa6 Viswas G              2020-11-02  414  		atomic_set(&pm8001_ha->devices[i].running_req, 0);
dbf9bfe615717d1 jack wang             2009-10-14  415  	}
dbf9bfe615717d1 jack wang             2009-10-14  416  	pm8001_ha->flags = PM8001F_INIT_TIME;
dbf9bfe615717d1 jack wang             2009-10-14  417  	/* Initialize tags */
dbf9bfe615717d1 jack wang             2009-10-14  418  	pm8001_tag_init(pm8001_ha);
dbf9bfe615717d1 jack wang             2009-10-14  419  	return 0;
27bc43bd7c42b39 Viswas G              2020-10-05  420  
05c6c029a44d9f4 Viswas G              2020-10-05  421  err_out_shost:
05c6c029a44d9f4 Viswas G              2020-10-05  422  	scsi_remove_host(pm8001_ha->shost);
27bc43bd7c42b39 Viswas G              2020-10-05  423  err_out_nodev:
27bc43bd7c42b39 Viswas G              2020-10-05  424  	for (i = 0; i < pm8001_ha->max_memcnt; i++) {
27bc43bd7c42b39 Viswas G              2020-10-05  425  		if (pm8001_ha->memoryMap.region[i].virt_ptr != NULL) {
27bc43bd7c42b39 Viswas G              2020-10-05  426  			pci_free_consistent(pm8001_ha->pdev,
27bc43bd7c42b39 Viswas G              2020-10-05  427  				(pm8001_ha->memoryMap.region[i].total_len +
27bc43bd7c42b39 Viswas G              2020-10-05  428  				pm8001_ha->memoryMap.region[i].alignment),
27bc43bd7c42b39 Viswas G              2020-10-05  429  				pm8001_ha->memoryMap.region[i].virt_ptr,
27bc43bd7c42b39 Viswas G              2020-10-05  430  				pm8001_ha->memoryMap.region[i].phys_addr);
27bc43bd7c42b39 Viswas G              2020-10-05  431  		}
27bc43bd7c42b39 Viswas G              2020-10-05  432  	}
dbf9bfe615717d1 jack wang             2009-10-14  433  err_out:
dbf9bfe615717d1 jack wang             2009-10-14  434  	return 1;
dbf9bfe615717d1 jack wang             2009-10-14  435  }
dbf9bfe615717d1 jack wang             2009-10-14  436  

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

Attachment: .config.gz
Description: application/gzip


[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